Class: FdxV660Api::FdxJwtProfile
- Defined in:
- lib/fdx_v660_api/models/fdx_jwt_profile.rb
Overview
FDX-extended JWT Profile enabling transport of ConsentGrant details in OAuth
access_token. Claim names and values are compliant with IETF specification
for JSON Web Token (JWT)
Instance Attribute Summary collapse
-
#aud ⇒ String
Identifies the relevant Consent party (Data Recipient).
-
#client_id ⇒ String
Identifies the relevant OAuth Client if not the same entity as the audience (intermediary).
-
#exp ⇒ Float
Expiration time of the token, formatted as NumericDate as defined by JSON Web Token (JWT).
-
#fdx_consent_id ⇒ String
Space-delimited array of FDX consentIds as
#/components/schemas/ConsentIdan empty array is acceptable and may be necessary in some implementations. -
#iat ⇒ Float
Issuance time of the token, formatted as NumericDate as defined by JSON Web Token (JWT).
-
#iss ⇒ String
Identifies the relevant Consent party (Data Provider).
-
#jti ⇒ String
Unique identifier for the token.
-
#nbf ⇒ Float
Not-before time of the token, formatted as NumericDate as defined by JSON Web Token (JWT).
-
#scope ⇒ String
Space-delimited array of scopes from
FdxOauthScopeplusopenidand/oroffline_access. -
#sub ⇒ String
Identifies the relevant End User using
customerId.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(iss:, sub:, aud:, exp:, scope:, fdx_consent_id:, iat: SKIP, nbf: SKIP, jti: SKIP, client_id: SKIP, additional_properties: nil) ⇒ FdxJwtProfile
constructor
A new instance of FdxJwtProfile.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(iss:, sub:, aud:, exp:, scope:, fdx_consent_id:, iat: SKIP, nbf: SKIP, jti: SKIP, client_id: SKIP, additional_properties: nil) ⇒ FdxJwtProfile
Returns a new instance of FdxJwtProfile.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 92 def initialize(iss:, sub:, aud:, exp:, scope:, fdx_consent_id:, iat: SKIP, nbf: SKIP, jti: SKIP, client_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @iss = iss @sub = sub @aud = aud @exp = exp @iat = iat unless iat == SKIP @nbf = nbf unless nbf == SKIP @jti = jti unless jti == SKIP @client_id = client_id unless client_id == SKIP @scope = scope @fdx_consent_id = @additional_properties = additional_properties end |
Instance Attribute Details
#aud ⇒ String
Identifies the relevant Consent party (Data Recipient)
24 25 26 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 24 def aud @aud end |
#client_id ⇒ String
Identifies the relevant OAuth Client if not the same entity as the audience (intermediary)
48 49 50 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 48 def client_id @client_id end |
#exp ⇒ Float
Expiration time of the token, formatted as NumericDate as defined by JSON Web Token (JWT)
29 30 31 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 29 def exp @exp end |
#fdx_consent_id ⇒ String
Space-delimited array of FDX consentIds as
#/components/schemas/ConsentId an empty array is acceptable and may be
necessary in some implementations
59 60 61 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 59 def @fdx_consent_id end |
#iat ⇒ Float
Issuance time of the token, formatted as NumericDate as defined by JSON Web Token (JWT)
34 35 36 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 34 def iat @iat end |
#iss ⇒ String
Identifies the relevant Consent party (Data Provider)
16 17 18 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 16 def iss @iss end |
#jti ⇒ String
Unique identifier for the token
43 44 45 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 43 def jti @jti end |
#nbf ⇒ Float
Not-before time of the token, formatted as NumericDate as defined by JSON Web Token (JWT)
39 40 41 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 39 def nbf @nbf end |
#scope ⇒ String
Space-delimited array of scopes from FdxOauthScope plus openid and/or
offline_access. Other (private) scopes may be also included.
53 54 55 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 53 def scope @scope end |
#sub ⇒ String
Identifies the relevant End User using customerId
20 21 22 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 20 def sub @sub end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 112 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. iss = hash.key?('iss') ? hash['iss'] : nil sub = hash.key?('sub') ? hash['sub'] : nil aud = hash.key?('aud') ? hash['aud'] : nil exp = hash.key?('exp') ? hash['exp'] : nil scope = hash.key?('scope') ? hash['scope'] : nil = hash.key?('fdxConsentId') ? hash['fdxConsentId'] : nil iat = hash.key?('iat') ? hash['iat'] : SKIP nbf = hash.key?('nbf') ? hash['nbf'] : SKIP jti = hash.key?('jti') ? hash['jti'] : SKIP client_id = hash.key?('client_id') ? hash['client_id'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. FdxJwtProfile.new(iss: iss, sub: sub, aud: aud, exp: exp, scope: scope, fdx_consent_id: , iat: iat, nbf: nbf, jti: jti, client_id: client_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 62 def self.names @_hash = {} if @_hash.nil? @_hash['iss'] = 'iss' @_hash['sub'] = 'sub' @_hash['aud'] = 'aud' @_hash['exp'] = 'exp' @_hash['iat'] = 'iat' @_hash['nbf'] = 'nbf' @_hash['jti'] = 'jti' @_hash['client_id'] = 'client_id' @_hash['scope'] = 'scope' @_hash['fdx_consent_id'] = 'fdxConsentId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
88 89 90 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 88 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
78 79 80 81 82 83 84 85 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 78 def self.optionals %w[ iat nbf jti client_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
157 158 159 160 161 162 163 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 157 def inspect class_name = self.class.name.split('::').last "<#{class_name} iss: #{@iss.inspect}, sub: #{@sub.inspect}, aud: #{@aud.inspect}, exp:"\ " #{@exp.inspect}, iat: #{@iat.inspect}, nbf: #{@nbf.inspect}, jti: #{@jti.inspect},"\ " client_id: #{@client_id.inspect}, scope: #{@scope.inspect}, fdx_consent_id:"\ " #{@fdx_consent_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
149 150 151 152 153 154 |
# File 'lib/fdx_v660_api/models/fdx_jwt_profile.rb', line 149 def to_s class_name = self.class.name.split('::').last "<#{class_name} iss: #{@iss}, sub: #{@sub}, aud: #{@aud}, exp: #{@exp}, iat: #{@iat}, nbf:"\ " #{@nbf}, jti: #{@jti}, client_id: #{@client_id}, scope: #{@scope}, fdx_consent_id:"\ " #{@fdx_consent_id}, additional_properties: #{@additional_properties}>" end |