Class: AtprotoAuth::PAR::Request
- Inherits:
-
Object
- Object
- AtprotoAuth::PAR::Request
- Defined in:
- lib/atproto_auth/par/request.rb
Overview
Represents a pushed authorization request
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#client_assertion ⇒ Object
readonly
Client authentication (for confidential clients).
-
#client_assertion_type ⇒ Object
readonly
Client authentication (for confidential clients).
-
#client_id ⇒ Object
readonly
Required parameters.
-
#code_challenge ⇒ Object
readonly
Required parameters.
-
#code_challenge_method ⇒ Object
readonly
Required parameters.
-
#dpop_proof ⇒ Object
readonly
Optional parameters.
-
#login_hint ⇒ Object
readonly
Optional parameters.
-
#nonce ⇒ Object
readonly
Optional parameters.
-
#redirect_uri ⇒ Object
readonly
Required parameters.
-
#response_type ⇒ Object
readonly
Required parameters.
-
#scope ⇒ Object
readonly
Required parameters.
-
#state ⇒ Object
readonly
Required parameters.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Request
constructor
A new instance of Request.
-
#to_form ⇒ String
Converts request to form-encoded parameters.
Constructor Details
#initialize(config) ⇒ Request
Returns a new instance of Request.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/atproto_auth/par/request.rb', line 31 def initialize(config) # Required parameters @response_type = "code" # Always "code" for AT Protocol OAuth @client_id = config.client_id @redirect_uri = config.redirect_uri @code_challenge = config.code_challenge @code_challenge_method = config.code_challenge_method @state = config.state @scope = config.scope # Optional parameters @login_hint = config.login_hint @nonce = config.nonce @dpop_proof = config.dpop_proof # Client authentication @client_assertion_type = config.client_assertion_type @client_assertion = config.client_assertion validate! end |
Instance Attribute Details
#client_assertion ⇒ Object (readonly)
Client authentication (for confidential clients)
23 24 25 |
# File 'lib/atproto_auth/par/request.rb', line 23 def client_assertion @client_assertion end |
#client_assertion_type ⇒ Object (readonly)
Client authentication (for confidential clients)
23 24 25 |
# File 'lib/atproto_auth/par/request.rb', line 23 def client_assertion_type @client_assertion_type end |
#client_id ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def client_id @client_id end |
#code_challenge ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def code_challenge @code_challenge end |
#code_challenge_method ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def code_challenge_method @code_challenge_method end |
#dpop_proof ⇒ Object (readonly)
Optional parameters
20 21 22 |
# File 'lib/atproto_auth/par/request.rb', line 20 def dpop_proof @dpop_proof end |
#login_hint ⇒ Object (readonly)
Optional parameters
20 21 22 |
# File 'lib/atproto_auth/par/request.rb', line 20 def login_hint @login_hint end |
#nonce ⇒ Object (readonly)
Optional parameters
20 21 22 |
# File 'lib/atproto_auth/par/request.rb', line 20 def nonce @nonce end |
#redirect_uri ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def redirect_uri @redirect_uri end |
#response_type ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def response_type @response_type end |
#scope ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def scope @scope end |
#state ⇒ Object (readonly)
Required parameters
16 17 18 |
# File 'lib/atproto_auth/par/request.rb', line 16 def state @state end |
Class Method Details
.build {|config| ... } ⇒ Object
25 26 27 28 29 |
# File 'lib/atproto_auth/par/request.rb', line 25 def self.build config = Configuration.new yield(config) new(config) end |
Instance Method Details
#to_form ⇒ String
Converts request to form-encoded parameters
55 56 57 |
# File 'lib/atproto_auth/par/request.rb', line 55 def to_form encode_params(build_params) end |