Class: Acme::Client::Resources::Challenges::Base
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Challenges::Base
- Defined in:
- lib/acme/client/resources/challenges/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #challenge_type ⇒ Object
-
#initialize(client, **arguments) ⇒ Base
constructor
A new instance of Base.
- #key_authorization ⇒ Object
- #reload ⇒ Object
- #request_validation ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client, **arguments) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/acme/client/resources/challenges/base.rb', line 6 def initialize(client, **arguments) @client = client assign_attributes(**arguments) end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/acme/client/resources/challenges/base.rb', line 4 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/acme/client/resources/challenges/base.rb', line 4 def status @status end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/acme/client/resources/challenges/base.rb', line 4 def token @token end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/acme/client/resources/challenges/base.rb', line 4 def url @url end |
Instance Method Details
#challenge_type ⇒ Object
11 12 13 |
# File 'lib/acme/client/resources/challenges/base.rb', line 11 def challenge_type self.class::CHALLENGE_TYPE end |
#key_authorization ⇒ Object
15 16 17 |
# File 'lib/acme/client/resources/challenges/base.rb', line 15 def "#{token}.#{@client.jwk.thumbprint}" end |
#reload ⇒ Object
19 20 21 22 |
# File 'lib/acme/client/resources/challenges/base.rb', line 19 def reload assign_attributes(**@client.challenge(url: url).to_h) true end |
#request_validation ⇒ Object
24 25 26 27 28 29 |
# File 'lib/acme/client/resources/challenges/base.rb', line 24 def request_validation assign_attributes(**send_challenge_validation( url: url )) true end |
#to_h ⇒ Object
31 32 33 |
# File 'lib/acme/client/resources/challenges/base.rb', line 31 def to_h { status: status, url: url, token: token, error: error } end |