Class: Puma::Acme::Authz

Inherits:
Struct
  • Object
show all
Defined in:
lib/puma/acme/structs.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#challengesObject

Returns the value of attribute challenges

Returns:

  • (Object)

    the current value of challenges



40
41
42
# File 'lib/puma/acme/structs.rb', line 40

def challenges
  @challenges
end

#expiresObject

Returns the value of attribute expires

Returns:

  • (Object)

    the current value of expires



40
41
42
# File 'lib/puma/acme/structs.rb', line 40

def expires
  @expires
end

#identifierObject

Returns the value of attribute identifier

Returns:

  • (Object)

    the current value of identifier



40
41
42
# File 'lib/puma/acme/structs.rb', line 40

def identifier
  @identifier
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



40
41
42
# File 'lib/puma/acme/structs.rb', line 40

def status
  @status
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



40
41
42
# File 'lib/puma/acme/structs.rb', line 40

def url
  @url
end

#wildcardObject

Returns the value of attribute wildcard

Returns:

  • (Object)

    the current value of wildcard



40
41
42
# File 'lib/puma/acme/structs.rb', line 40

def wildcard
  @wildcard
end

Class Method Details

.from(acme_authz) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/puma/acme/structs.rb', line 41

def self.from(acme_authz)
  identifier = Identifier.from(acme_authz.identifier)
  challenges = acme_authz.challenges
                         .reject { |c| c.is_a?(::Acme::Client::Resources::Challenges::Unsupported) }
                         .map { |c| Challenge.from(c) }

  new(acme_authz.to_h.slice(*members).merge(challenges: challenges, identifier: identifier))
end