Skip to content

Commit 9ee8b17

Browse files
feat: CIMD Metadata Policy (#153)
1 parent 6e99798 commit 9ee8b17

3 files changed

Lines changed: 235 additions & 1 deletion

File tree

CHANGES.ja.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
変更点
22
======
33

4+
- `Service` クラス
5+
* `isCimdMetadataPolicyEnabled()` メソッドを追加。
6+
* `setCimdMetadataPolicyEnabled(boolean)` メソッドを追加。
7+
* `getCimdMetadataPolicy()` メソッドを追加。
8+
* `setCimdMetadataPolicy(String)` メソッドを追加。
9+
10+
411
4.32 (2025 年 12 月 01 日)
512
--------------------------
613

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGES
22
=======
33

4+
- `Service` class
5+
* Added the `isCimdMetadataPolicyEnabled()` method.
6+
* Added the `setCimdMetadataPolicyEnabled(boolean)` method.
7+
* Added the `getCimdMetadataPolicy()` method.
8+
* Added the `setCimdMetadataPolicy(String)` method.
9+
10+
411
4.32 (2025-12-01)
512
-----------------
613

src/main/java/com/authlete/common/dto/Service.java

Lines changed: 221 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
*/
331331
public class Service implements Serializable
332332
{
333-
private static final long serialVersionUID = 88L;
333+
private static final long serialVersionUID = 89L;
334334

335335

336336
/*
@@ -1951,6 +1951,26 @@ public class Service implements Serializable
19511951
private boolean cimdQueryPermitted;
19521952

19531953

1954+
/**
1955+
* Whether to apply the metadata policy to client metadata that is obtained
1956+
* through the CIMD mechanism.
1957+
*
1958+
* @since 4.33
1959+
* @since Authlete 3.0.23
1960+
*/
1961+
private boolean cimdMetadataPolicyEnabled;
1962+
1963+
1964+
/**
1965+
* The metadata policy applied to client metadata that is obtained through
1966+
* the CIMD mechanism.
1967+
*
1968+
* @since 4.33
1969+
* @since Authlete 3.0.23
1970+
*/
1971+
private String cimdMetadataPolicy;
1972+
1973+
19541974
/**
19551975
* Whether to prohibit client ID aliases that start with {@code https://}
19561976
* or {@code http://}.
@@ -12724,6 +12744,206 @@ public Service setCimdQueryPermitted(boolean permitted)
1272412744
}
1272512745

1272612746

12747+
/**
12748+
* Get the flag that indicates whether to apply the metadata policy to
12749+
* client metadata that is obtained through the <a href=
12750+
* "https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/"
12751+
* >CIMD</a> mechanism.
12752+
*
12753+
* <p>
12754+
* If this flag is set to {@code true}, the metadata policy specified by
12755+
* the {@code cimdMetadataPolicy} property, if available, is applied to
12756+
* the client metadata that is obtained through the CIMD mechanism.
12757+
* </p>
12758+
*
12759+
* @return
12760+
* {@code true} if the metadata policy is applied to client
12761+
* metadata that is obtained through the CIMD mechanism.
12762+
*
12763+
* @since 4.33
12764+
* @since Authlete 3.0.23
12765+
*
12766+
* @see <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/">
12767+
* OAuth Client ID Metadata Document</a>
12768+
*/
12769+
public boolean isCimdMetadataPolicyEnabled()
12770+
{
12771+
return cimdMetadataPolicyEnabled;
12772+
}
12773+
12774+
12775+
/**
12776+
* Set the flag that indicates whether to apply the metadata policy to
12777+
* client metadata that is obtained through the <a href=
12778+
* "https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/"
12779+
* >CIMD</a> mechanism.
12780+
*
12781+
* <p>
12782+
* If this flag is set to {@code true}, the metadata policy specified by
12783+
* the {@code cimdMetadataPolicy} property, if available, is applied to
12784+
* the client metadata that is obtained through the CIMD mechanism.
12785+
* </p>
12786+
*
12787+
* @param enabled
12788+
* {@code true} to apply the metadata policy to client metadata
12789+
* that is obtained through the CIMD mechanism.
12790+
*
12791+
* @return
12792+
* {@code this} object.
12793+
*
12794+
* @since 4.33
12795+
* @since Authlete 3.0.23
12796+
*
12797+
* @see <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/">
12798+
* OAuth Client ID Metadata Document</a>
12799+
*/
12800+
public Service setCimdMetadataPolicyEnabled(boolean enabled)
12801+
{
12802+
this.cimdMetadataPolicyEnabled = enabled;
12803+
12804+
return this;
12805+
}
12806+
12807+
12808+
/**
12809+
* Get the metadata policy applied to client metadata that is obtained
12810+
* through the <a href=
12811+
* "https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/"
12812+
* >CIMD</a> mechanism.
12813+
*
12814+
* <p>
12815+
* If the {@code cimdMetadataPolicyEnabled} property is set to {@code true},
12816+
* the metadata policy specified by this {@code cimdMetadataPolicy} property
12817+
* is applied to client metadata that is obtained through the CIMD mechanism.
12818+
* </p>
12819+
*
12820+
* <p>
12821+
* The metadata policy must comply with the grammar defined in <a href=
12822+
* "https://openid.net/specs/openid-federation-1_0.html#name-metadata-policy"
12823+
* >6.1. Metadata Policy</a> of the <a href=
12824+
* "https://openid.net/specs/openid-federation-1_0.html">OpenID Federation
12825+
* 1.0</a> specification. Below is an example of metadata policy:
12826+
* </p>
12827+
*
12828+
* <pre style="border: 1px solid black; margin: 1em; padding-top: 0.5em; padding-bottom: 0.5em;">
12829+
* {
12830+
* <font color="navy">"grant_types"</font>: {
12831+
* <font color="darkgreen">"default"</font>: [
12832+
* <font color="brown">"authorization_code"</font>
12833+
* ],
12834+
* <font color="darkgreen">"subset_of"</font>: [
12835+
* <font color="brown">"authorization_code"</font>,
12836+
* <font color="brown">"refresh_token"</font>
12837+
* ],
12838+
* <font color="darkgreen">"superset_of"</font>: [
12839+
* <font color="brown">"authorization_code"</font>
12840+
* ]
12841+
* },
12842+
* <font color="navy">"token_endpoint_auth_method"</font>: {
12843+
* <font color="darkgreen">"one_of"</font>: [
12844+
* <font color="brown">"private_key_jwt"</font>,
12845+
* <font color="brown">"self_signed_tls_client_auth"</font>
12846+
* ],
12847+
* <font color="darkgreen">"essential"</font>: <font color="chocolate">true</font>
12848+
* },
12849+
* <font color="navy">"token_endpoint_auth_signing_alg"</font> : {
12850+
* <font color="darkgreen">"one_of"</font>: [
12851+
* <font color="brown">"PS256"</font>,
12852+
* <font color="brown">"ES256</font>"
12853+
* ]
12854+
* }
12855+
* }</pre>
12856+
*
12857+
* @return
12858+
* The metadata policy applied to client metadata that is obtained
12859+
* through the CIMD mechanism.
12860+
*
12861+
* @since 4.33
12862+
* @since Authlete 3.0.23
12863+
*
12864+
* @see <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/">
12865+
* OAuth Client ID Metadata Document</a>
12866+
* @see <a href="https://openid.net/specs/openid-federation-1_0.html#name-metadata-policy">
12867+
* OpenID Federation 1.0, Section 6.1. Metadata Policy</a>
12868+
*/
12869+
public String getCimdMetadataPolicy()
12870+
{
12871+
return cimdMetadataPolicy;
12872+
}
12873+
12874+
12875+
/**
12876+
* Set the metadata policy applied to client metadata that is obtained
12877+
* through the <a href=
12878+
* "https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/"
12879+
* >CIMD</a> mechanism.
12880+
*
12881+
* <p>
12882+
* If the {@code cimdMetadataPolicyEnabled} property is set to {@code true},
12883+
* the metadata policy specified by this {@code cimdMetadataPolicy} property
12884+
* is applied to client metadata that is obtained through the CIMD mechanism.
12885+
* </p>
12886+
*
12887+
* <p>
12888+
* The metadata policy must comply with the grammar defined in <a href=
12889+
* "https://openid.net/specs/openid-federation-1_0.html#name-metadata-policy"
12890+
* >6.1. Metadata Policy</a> of the <a href=
12891+
* "https://openid.net/specs/openid-federation-1_0.html">OpenID Federation
12892+
* 1.0</a> specification. Below is an example of metadata policy:
12893+
* </p>
12894+
*
12895+
* <pre style="border: 1px solid black; margin: 1em; padding-top: 0.5em; padding-bottom: 0.5em;">
12896+
* {
12897+
* <font color="navy">"grant_types"</font>: {
12898+
* <font color="darkgreen">"default"</font>: [
12899+
* <font color="brown">"authorization_code"</font>
12900+
* ],
12901+
* <font color="darkgreen">"subset_of"</font>: [
12902+
* <font color="brown">"authorization_code"</font>,
12903+
* <font color="brown">"refresh_token"</font>
12904+
* ],
12905+
* <font color="darkgreen">"superset_of"</font>: [
12906+
* <font color="brown">"authorization_code"</font>
12907+
* ]
12908+
* },
12909+
* <font color="navy">"token_endpoint_auth_method"</font>: {
12910+
* <font color="darkgreen">"one_of"</font>: [
12911+
* <font color="brown">"private_key_jwt"</font>,
12912+
* <font color="brown">"self_signed_tls_client_auth"</font>
12913+
* ],
12914+
* <font color="darkgreen">"essential"</font>: <font color="chocolate">true</font>
12915+
* },
12916+
* <font color="navy">"token_endpoint_auth_signing_alg"</font> : {
12917+
* <font color="darkgreen">"one_of"</font>: [
12918+
* <font color="brown">"PS256"</font>,
12919+
* <font color="brown">"ES256</font>"
12920+
* ]
12921+
* }
12922+
* }</pre>
12923+
*
12924+
* @param policy
12925+
* The metadata policy applied to client metadata that is obtained
12926+
* through the CIMD mechanism.
12927+
*
12928+
* @return
12929+
* {@code this} object.
12930+
*
12931+
* @since 4.33
12932+
* @since Authlete 3.0.23
12933+
*
12934+
* @see <a href="https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/">
12935+
* OAuth Client ID Metadata Document</a>
12936+
* @see <a href="https://openid.net/specs/openid-federation-1_0.html#name-metadata-policy">
12937+
* OpenID Federation 1.0, Section 6.1. Metadata Policy</a>
12938+
*/
12939+
public Service setCimdMetadataPolicy(String policy)
12940+
{
12941+
this.cimdMetadataPolicy = policy;
12942+
12943+
return this;
12944+
}
12945+
12946+
1272712947
/**
1272812948
* Get the flag that indicates whether to prohibit client ID aliases that
1272912949
* start with {@code https://} or {@code http://}.

0 commit comments

Comments
 (0)