lib/authlete/model/service.rb in authlete-0.2.2 vs lib/authlete/model/service.rb in authlete-0.2.3
- old
+ new
@@ -59,10 +59,16 @@
# The URI of the authorization endpoint. (URI)
attr_accessor :authorizationEndpoint
alias_method :authorization_endpoint, :authorizationEndpoint
alias_method :authorization_endpoint=, :authorizationEndpoint=
+ # The number of client applications that one developer can create.
+ # 0 means no limit.
+ attr_accessor :clientPerDeveloper
+ alias_method :client_per_developer, :clientPerDeveloper
+ alias_method :client_per_developer=, :clientPerDeveloper=
+
# The timestamp at which the service was created. (Integer)
attr_accessor :createdAt
alias_method :created_at, :createdAt
alias_method :created_at=, :createdAt=
@@ -87,10 +93,45 @@
# The list of SNS credentials for developer login. (SnsCredentials array)
attr_accessor :developerSnsCredentials
alias_method :developer_sns_credentials, :developerSnsCredentials
alias_method :developer_sns_credentials=, :developerSnsCredentials=
+ # The flag to indicate whether the direct authorization endpoint
+ # is enabled or not. The path of the endpoint is
+ # <code>/api/auth/authorization/direct/{serviceApiKey}</code>
+ attr_accessor :directAuthorizationEndpointEnabled
+ alias_method :direct_authorization_endpoint_enabled, :directAuthorizationEndpointEnabled
+ alias_method :direct_authorization_endpoint_enabled=, :directAuthorizationEndpointEnabled=
+
+ # The flag to indicate whether the direct jwks endpoint
+ # is enabled or not. The path of the endpoint is
+ # <code>/api/service/jwks/get/direct/{serviceApiKey}</code>
+ attr_accessor :directJwksEndpointEnabled
+ alias_method :direct_jwks_endpoint_enabled, :directJwksEndpointEnabled
+ alias_method :direct_jwks_endpoint_enabled=, :directJwksEndpointEnabled=
+
+ # The flag to indicate whether the direct revocation endpoint
+ # is enabled or not. The path of the endpoint is
+ # <code>/api/auth/revocation/direct/{serviceApiKey}</code>
+ attr_accessor :directRevocationEndpointEnabled
+ alias_method :direct_revocation_endpoint_enabled, :directRevocationEndpointEnabled
+ alias_method :direct_revocation_endpoint_enabled=, :directRevocationEndpointEnabled=
+
+ # The flag to indicate whether the direct token endpoint
+ # is enabled or not. The path of the endpoint is
+ # <code>/api/auth/token/direct/{serviceApiKey}</code>
+ attr_accessor :directTokenEndpointEnabled
+ alias_method :direct_token_endpoint_enabled, :directTokenEndpointEnabled
+ alias_method :direct_token_endpoint_enabled=, :directTokenEndpointEnabled=
+
+ # The flag to indicate whether the direct user info endpoint
+ # is enabled or not. The path of the endpoint is
+ # <code>/api/auth/userinfo/direct/{serviceApiKey}</code>
+ attr_accessor :directUserInfoEndpointEnabled
+ alias_method :direct_user_info_endpoint_enabled, :directUserInfoEndpointEnabled
+ alias_method :direct_user_info_endpoint_enabled=, :directUserInfoEndpointEnabled=
+
# The duration of ID tokens in seconds. (Integer)
attr_accessor :idTokenDuration
alias_method :id_token_duration, :idTokenDuration
alias_method :id_token_duration=, :idTokenDuration=
@@ -129,10 +170,15 @@
# The URI of the registration endpoint. (URI)
attr_accessor :registrationEndpoint
alias_method :registration_endpoint, :registrationEndpoint
alias_method :registration_endpoint=, :registrationEndpoint=
+ # The URI of the token revocation endpoint. (URI)
+ attr_accessor :revocationEndpoint
+ alias_method :revocation_endpoint, :revocationEndpoint
+ alias_method :revocation_endpoint=, :revocationEndpoint=
+
# The URI of the service's documentation. (URI)
attr_accessor :serviceDocumentation
alias_method :service_documentation, :serviceDocumentation
alias_method :service_documentation=, :serviceDocumentation=
@@ -233,31 +279,37 @@
# The URI of the service's "Terms Of Service" page. (URI)
attr_accessor :tosUri
alias_method :tos_uri, :tosUri
alias_method :tos_uri=, :tosUri=
- # The URI of UserInfo endpoint. (URI)
+ # The URI of user info endpoint. (URI)
attr_accessor :userInfoEndpoint
alias_method :user_info_endpoint, :userInfoEndpoint
alias_method :user_info_endpoint=, :userInfoEndpoint=
private
# Integer attributes.
INTEGER_ATTRIBUTES = ::Set.new([
- :accessTokenDuration, :apiKey, :createdAt, :idTokenDuration,
- :modifiedAt, :number, :refreshTokenDuration, :serviceOwnerNumber
+ :accessTokenDuration, :apiKey, :clientPerDeveloper, :createdAt,
+ :idTokenDuration, :modifiedAt, :number, :refreshTokenDuration, :serviceOwnerNumber
])
+ # Boolean attributes.
+ BOOLEAN_ATTRIBUTES = ::Set.new([
+ :directAuthorizationEndpointEnabled, :directJwksEndpointEnabled, :directRevocationEndpointEnabled,
+ :directTokenEndpointEnabled, :directUserInfoEndpointEnabled
+ ])
+
# String attributes.
STRING_ATTRIBUTES = ::Set.new([
:accessTokenType, :apiSecret, :authenticationCallbackApiKey,
:authenticationCallbackApiSecret, :authenticationCallbackEndpoint,
:authorizationEndpoint, :description, :developerAuthenticationCallbackApiKey,
:developerAuthenticationCallbackApiSecret, :developerAuthenticationCallbackEndpoint,
:issuer, :jwks, :jwksUri, :policyUri, :registrationEndpoint, :serviceDocumentation,
- :serviceName, :tokenEndpoint, :tosUri, :userInfoEndpoint
+ :serviceName, :tokenEndpoint, :tosUri, :userInfoEndpoint, :revocationEndpoint
])
# String array attributes.
STRING_ARRAY_ATTRIBUTES = ::Set.new([
:properties, :supportedAcrs, :supportedClaimLocales, :supportedClaims,
@@ -274,15 +326,21 @@
:api_secret => :apiSecret,
:authentication_callback_api_key => :authenticationCallbackApiKey,
:authentication_callback_api_secret => :authenticationCallbackApiSecret,
:authentication_callback_endpoint => :authenticationCallbackEndpoint,
:authorization_endpoint => :authorizationEndpoint,
- :developer_authentication_callback_api_key => :developerAuthenticationCallbackApiKey,
+ :developer_authentication_callback_api_key => :developerAuthenticationCallbackApiKey,
:developer_authentication_callback_api_secret => :developerAuthenticationCallbackApiSecret,
:developer_authentication_callback_endpoint => :developerAuthenticationCallbackEndpoint,
:developer_sns_credentials => :developerSnsCredentials,
+ :client_per_developer => :clientPerDeveloper,
:created_at => :createdAt,
+ :direct_authorization_endpoint_enabled => :directAuthorizationEndpointEnabled,
+ :direct_jwks_endpoint_enabled => :directJwksEndpointEnabled,
+ :direct_revocation_endpoint_enabled => :directRevocationEndpointEnabled,
+ :direct_token_endpoint_enabled => :directTokenEndpointEnabled,
+ :direct_user_info_endpoint_enabled => :directUserInfoEndpointEnabled,
:id_tokn_duration => :idTokenDuration,
:jwks_uri => :jwksUri,
:modified_at => :modifiedAt,
:policy_uri => :policyUri,
:refresh_token_duration => :refreshTokenDuration,
@@ -313,10 +371,15 @@
# Set default values to integer attributes.
INTEGER_ATTRIBUTES.each do |attr|
send("#{attr}=", 0)
end
+ # Set default values to boolean attributes.
+ BOOLEAN_ATTRIBUTES.each do |attr|
+ send("#{attr}=", false)
+ end
+
# Set default values to string attributes.
STRING_ATTRIBUTES.each do |attr|
send("#{attr}=", nil)
end
@@ -345,9 +408,10 @@
return key
end
def authlete_model_service_simple_attribute?(key)
INTEGER_ATTRIBUTES.include?(key) or
+ BOOLEAN_ATTRIBUTES.include?(key) or
STRING_ATTRIBUTES.include?(key) or
STRING_ARRAY_ATTRIBUTES.include?(key)
end
def authlete_model_service_update(hash)