lib/authlete/model/service.rb in authlete-1.0.4 vs lib/authlete/model/service.rb in authlete-1.0.5

- old
+ new

@@ -310,10 +310,15 @@ # The list of supported scopes. (Scope array) attr_accessor :supportedScopes alias_method :supported_scopes, :supportedScopes alias_method :supported_scopes=, :supportedScopes= + # The list of supported service profiles. (String array) + attr_accessor :supportedServiceProfiles + alias_method :supported_service_profiles, :supportedServiceProfiles + alias_method :supported_service_profiles=, :supportedServiceProfiles= + # The list of supported SNSes. (Sns array) attr_accessor :supportedSnses alias_method :supported_snses, :supportedSnses alias_method :supported_snses=, :supportedSnses= @@ -346,13 +351,19 @@ alias_method :user_info_endpoint=, :userInfoEndpoint= # The key ID to identify a JWK used for user info signature using an # asymmetric key. (String) attr_accessor :userInfoSignatureKeyId - alias_method :user_info_signature_key_id, :userInfoSignatureKeyId - alias_method :user_info_signature_key_id=, :userInfoSignatureKeyId= + alias_method :user_info_signature_key_id, :userInfoSignatureKeyId + alias_method :user_info_signature_key_id=, :userInfoSignatureKeyId= + # The flag that indicates whether the service offers sender authenticated MTLS bound + # access tokens. + attr_accessor :mutualTlsSenderConstrainedAccessTokens + alias_method :mutual_tls_sender_constrained_access_tokens, :mutualTlsSenderConstrainedAccessTokens + alias_method :mutual_tls_sender_constrained_access_tokens=, :mutualTlsSenderConstrainedAccessTokens= + private # Integer attributes. INTEGER_ATTRIBUTES = ::Set.new([ :accessTokenDuration, :apiKey, :clientsPerDeveloper, :createdAt, @@ -363,11 +374,12 @@ BOOLEAN_ATTRIBUTES = ::Set.new([ :clientIdAliasEnabled, :directAuthorizationEndpointEnabled, :directIntrospectionEndpointEnabled, :directJwksEndpointEnabled, :directRevocationEndpointEnabled, :directTokenEndpointEnabled, :directUserInfoEndpointEnabled, :errorDescriptionOmitted, :errorUriOmitted, - :pkceRequired, :refreshTokenKept, :singleAccessTokenPerSubject + :pkceRequired, :refreshTokenKept, :singleAccessTokenPerSubject, + :mutualTlsSenderConstrainedAccessTokens ]) # String attributes. STRING_ATTRIBUTES = ::Set.new([ :accessTokenType, :apiSecret, :authenticationCallbackApiKey, @@ -381,14 +393,19 @@ # String array attributes. STRING_ARRAY_ATTRIBUTES = ::Set.new([ :supportedAcrs, :supportedClaimLocales, :supportedClaims, :supportedClaimTypes, :supportedDeveloperSnses, :supportedDisplays, - :supportedGrantTypes, :supportedResponseTypes, :supportedSnses, - :supportedTokenAuthMethods, :supportedUiLocales + :supportedGrantTypes, :supportedResponseTypes, :supportedServiceProfiles, + :supportedSnses, :supportedTokenAuthMethods, :supportedUiLocales ]) + # SNS credentials array attributes. + SNS_CREDENTIALS_ARRAY_ATTRIBUTES = ::Set.new([ + :snsCredentials, :developerSnsCredentials + ]) + # Mapping from snake cases to camel cases. SNAKE_TO_CAMEL = { :access_token_duration => :accessTokenDuration, :access_token_type => :accessTokenType, :api_key => :apiKey, @@ -434,17 +451,19 @@ :supported_developer_snses => :supportedDeveloperSnses, :supported_displays => :supportedDisplays, :supported_grant_types => :supportedGrantTypes, :supported_response_types => :supportedResponseTypes, :supported_scopes => :supportedScopes, + :supported_service_profiles => :supportedServiceProfiles, :supported_snses => :supportedSnses, :supported_token_auth_methods => :supportedTokenAuthMethods, :supported_ui_locales => :supportedUiLocales, :token_endpoint => :tokenEndpoint, :tos_uri => :tosUri, :user_info_endpoint => :userInfoEndpoint, - :user_info_signature_key_id => :userInfoSignatureKeyId + :user_info_signature_key_id => :userInfoSignatureKeyId, + :mutual_tls_sender_constrained_access_tokens => :mutualTlsSenderConstrainedAccessTokens } # The constructor def initialize(hash = nil) # Set default values to integer attributes. @@ -465,15 +484,18 @@ # Set default values to string array attributes. STRING_ARRAY_ATTRIBUTES.each do |attr| send("#{attr}=", nil) end + # Set default values to sns credentials array attributes. + SNS_CREDENTIALS_ARRAY_ATTRIBUTES.each do |attr| + send("#{attr}=", nil) + end + # Set default values to special objects. - @developerSnsCredentials = nil - @metadata = nil - @snsCredentials = nil - @supportedScopes = nil + @metadata = nil + @supportedScopes = nil # Set attribute values using the given hash. authlete_model_update(hash) end @@ -501,20 +523,19 @@ hash.each do |key, value| key = authlete_model_convert_key(key) if authlete_model_simple_attribute?(key) send("#{key}=", value) - elsif key == :developerSnsCredentials - @developerSnsCredentials = get_parsed_array(value) do |element| + elsif SNS_CREDENTIALS_ARRAY_ATTRIBUTES.include?(key) + # Get an array consisting of "SnsCredentials" objects. + parsed = get_parsed_array(value) do |element| Authlete::Model::SnsCredentials.parse(element) end + + send("#{key}=", parsed) elsif key == :metadata @metadata = get_parsed_array(value) do |element| Authlete::Model::Pair.parse(element) - end - elsif key == :snsCredentials - @snsCredentials = get_parsed_array(value) do |element| - Authlete::Model::SnsCredentials.parse(element) end elsif key == :supportedScopes @supportedScopes = get_parsed_array(value) do |element| Authlete::Model::Scope.parse(element) end \ No newline at end of file