Class ServiceConfigurationRequest
- java.lang.Object
-
- com.authlete.common.dto.ServiceConfigurationRequest
-
- All Implemented Interfaces:
Serializable
public class ServiceConfigurationRequest extends Object implements Serializable
The request parameters of Authlete's/service/configurationAPI.pretty
If
pretty=trueis given to the Authlete API, the returned JSON is formatted in a human-friendly way.patch
The
/service/configurationAPI returns JSON that conforms to OpenID Connect Discovery 1.0. Implementations of the discovery endpoint may modify the JSON before returning it as a discovery response.Although implementations of the discovery endpoint have perfect control over the JSON, in some cases implementations may want to make the Authlete API execute adjustments on Authlete side so that the implementations can avoid modifying the received JSON after the API call.
The
patchrequest parameter has been added for the purpose.Implementations of the discovery endpoint may specify a JSON Patch by the
patchrequest parameter. If the request parameter is given, the Authlete API applies the patch to the JSON before returning it to the API caller.The value of the
patchrequest parameter must conform to the format that is defined in RFC 6902 JavaScript Object Notation (JSON) Patch.Example 1: Replace
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration | jq .subject_types_supported [ "public", "pairwise" ]
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration -d patch='[{"op":"replace","path":"/subject_types_supported","value":["public"]}]' | jq .subject_types_supported [ "public" ]Example 2: Add
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration | jq .custom_metadata null
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration -d patch='[{"op":"add","path":"/custom_metadata","value":"custom_value"}]' | jq .custom_metadata "custom_value"Example 3: Add Array Elements
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration | jq .acr_values_supported [ "acr1" ]
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration -d patch='[{"op":"add","path":"/acr_values_supported/0","value":"acr0"}]' | jq .acr_values_supported [ "acr0", "acr1" ]$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration -d patch='[{"op":"add","path":"/acr_values_supported/0","value":"acr0"}, {"op":"add","path":"/acr_values_supported/-","value":"acr2"}]' | jq .acr_values_supported [ "acr0", "acr1", "acr2" ]Example 4: Add Object Elements
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration | jq .mtls_endpoint_aliases { "authorization_endpoint": "https://as.example.com/mtls/authorize" }$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration -d patch='[{"op":"add","path":"/mtls_endpoint_aliases/token_endpoint","value":"https://as.example.com/mtls/token"}]' | jq .mtls_endpoint_aliases { "authorization_endpoint": "https://as.example.com/mtls/authorize", "token_endpoint": "https://as.example.com/mtls/token" }Example 5: Remove
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration | jq .acr_values_supported [ "acr1" ]
$ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration -d patch='[{"op":"remove","path":"/acr_values_supported"}]' | jq .acr_values_supported nullNote
The
patchrequest parameter is supported since Authlete 2.2.36.- Since:
- 3.43
- See Also:
- OpenID Connect Discovery 1.0, RFC 6902 JavaScript Object Notation (JSON) Patch, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceConfigurationRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetPatch()Get the JSON Patch (RFC 6902 JavaScript Object Notation (JSON) Patch) to be applied.booleanisPretty()Get the flag indicating whether the JSON returned from the API is formatted in a human-friendly way.ServiceConfigurationRequestsetPatch(String patch)Set a JSON Patch (RFC 6902 JavaScript Object Notation (JSON) Patch) to be applied.ServiceConfigurationRequestsetPretty(boolean pretty)Set the flag indicating whether the JSON returned from the API is formatted in a human-friendly way.
-
-
-
Method Detail
-
isPretty
public boolean isPretty()
Get the flag indicating whether the JSON returned from the API is formatted in a human-friendly way.- Returns:
trueif the JSON is formatted in a human-friendly way.
-
setPretty
public ServiceConfigurationRequest setPretty(boolean pretty)
Set the flag indicating whether the JSON returned from the API is formatted in a human-friendly way.- Parameters:
pretty-trueto format the JSON in a human-friendly way.- Returns:
thisobject.
-
getPatch
public String getPatch()
Get the JSON Patch (RFC 6902 JavaScript Object Notation (JSON) Patch) to be applied.- Returns:
- The JSON Patch.
- See Also:
- RFC 6902 JavaScript Object Notation (JSON) Patch
-
setPatch
public ServiceConfigurationRequest setPatch(String patch)
Set a JSON Patch (RFC 6902 JavaScript Object Notation (JSON) Patch) to be applied.- Parameters:
patch- A JSON Patch.- Returns:
thisobject.- See Also:
- RFC 6902 JavaScript Object Notation (JSON) Patch
-
-