Class: SignIn::StatePayloadJwtEncoder

Inherits:
Object
  • Object
show all
Defined in:
app/services/sign_in/state_payload_jwt_encoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code_challenge:, code_challenge_method:, acr:, client_config:, type:, client_state: nil) ⇒ StatePayloadJwtEncoder

rubocop:disable Metrics/ParameterLists



8
9
10
11
12
13
14
15
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 8

def initialize(code_challenge:, code_challenge_method:, acr:, client_config:, type:, client_state: nil)
  @acr = acr
  @client_config = client_config
  @type = type
  @code_challenge = code_challenge
  @code_challenge_method = code_challenge_method
  @client_state = client_state
end

Instance Attribute Details

#acrObject (readonly)

Returns the value of attribute acr.



5
6
7
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 5

def acr
  @acr
end

#client_configObject (readonly)

Returns the value of attribute client_config.



5
6
7
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 5

def client_config
  @client_config
end

#client_stateObject (readonly)

Returns the value of attribute client_state.



5
6
7
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 5

def client_state
  @client_state
end

#code_challengeObject (readonly)

Returns the value of attribute code_challenge.



5
6
7
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 5

def code_challenge
  @code_challenge
end

#code_challenge_methodObject (readonly)

Returns the value of attribute code_challenge_method.



5
6
7
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 5

def code_challenge_method
  @code_challenge_method
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 5

def type
  @type
end

Instance Method Details

#performObject

rubocop:enable Metrics/ParameterLists



18
19
20
21
22
23
# File 'app/services/sign_in/state_payload_jwt_encoder.rb', line 18

def perform
  validate_pkce_params if client_config.pkce?
  validate_state_payload
  save_state_code
  jwt_encode_state_payload
end