Skip to content

Commit 7939bf3

Browse files
committed
issue-1357: Add attribute allowpublic to uaa Client resource
1 parent feadaec commit 7939bf3

12 files changed

Lines changed: 51 additions & 8 deletions

File tree

cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/uaa/clients/ReactorClientsTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ void batchChangeSecret() {
133133
.resourceId("none")
134134
.scopes("clients.read", "clients.write")
135135
.tokenSalt("uHICvG")
136+
.allowPublic(true)
136137
.build())
137138
.client(
138139
Client.builder()
@@ -155,6 +156,7 @@ void batchChangeSecret() {
155156
.resourceId("none")
156157
.scopes("clients.read", "clients.write")
157158
.tokenSalt("WjlWvu")
159+
.allowPublic(true)
158160
.build())
159161
.build())
160162
.expectComplete()
@@ -279,6 +281,7 @@ void batchDelete() {
279281
.client(
280282
Client.builder()
281283
.approvalsDeleted(true)
284+
.allowPublic(true)
282285
.allowedProviders("uaa", "ldap", "my-saml-provider")
283286
.authorities("clients.read", "clients.write")
284287
.authorizedGrantType(CLIENT_CREDENTIALS)
@@ -296,6 +299,7 @@ void batchDelete() {
296299
.client(
297300
Client.builder()
298301
.approvalsDeleted(true)
302+
.allowPublic(true)
299303
.allowedProviders("uaa", "ldap", "my-saml-provider")
300304
.authorities("clients.read", "clients.write")
301305
.authorizedGrantType(CLIENT_CREDENTIALS)
@@ -469,6 +473,7 @@ void create() {
469473
.authorities("clients.read", "clients.write")
470474
.authorizedGrantType(CLIENT_CREDENTIALS)
471475
.autoApprove("true")
476+
.allowPublic(true)
472477
.clientId("aPq3I1")
473478
.clientSecret("secret")
474479
.name("My Client Name")
@@ -494,6 +499,7 @@ void create() {
494499
.resourceId("none")
495500
.scopes("clients.read", "clients.write")
496501
.tokenSalt("hRZ21X")
502+
.allowPublic(true)
497503
.build())
498504
.expectComplete()
499505
.verify(Duration.ofSeconds(5));
@@ -819,6 +825,7 @@ void mixedActions() {
819825
.refreshTokenValidity(7000L)
820826
.scopes("clients.read", "clients.write")
821827
.tokenSalt("UpzrHR")
828+
.allowPublic(true)
822829
.build())
823830
.build())
824831
.as(StepVerifier::create)
@@ -852,6 +859,7 @@ void mixedActions() {
852859
.resourceId("none")
853860
.scopes("clients.read", "clients.write")
854861
.tokenSalt("WjlWvu")
862+
.allowPublic(true)
855863
.build())
856864
.client(
857865
ActionClient.builder()
@@ -871,6 +879,7 @@ void mixedActions() {
871879
.resourceId("none")
872880
.scopes("clients.read", "clients.write")
873881
.tokenSalt("UpzrHR")
882+
.allowPublic(true)
874883
.build())
875884
.build())
876885
.expectComplete()
@@ -901,6 +910,7 @@ void update() {
901910
.autoApprove("clients.autoapprove")
902911
.clientId("55pTMX")
903912
.scopes("clients.new", "clients.autoapprove")
913+
.allowPublic(true)
904914
.build())
905915
.as(StepVerifier::create)
906916
.expectNext(
@@ -918,6 +928,7 @@ void update() {
918928
.resourceId("none")
919929
.scopes("clients.new", "clients.autoapprove")
920930
.tokenSalt("8mwCEy")
931+
.allowPublic(true)
921932
.build())
922933
.expectComplete()
923934
.verify(Duration.ofSeconds(5));

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_request.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
"clients.read",
2626
"clients.write"
2727
],
28-
"token_salt": "hRZ21X"
28+
"token_salt": "hRZ21X",
29+
"allowpublic": true
2930
}

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_response.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828
"my-saml-provider"
2929
],
3030
"name": "My Client Name",
31+
"allowpublic": true,
3132
"lastModified": 1468364445109
3233
}

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_delete_response.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
],
3131
"name": "My Client Name",
3232
"lastModified": 1468364444461,
33-
"approvals_deleted": true
33+
"approvals_deleted": true,
34+
"allowpublic": true
3435
},
3536
{
3637
"scope": [
@@ -63,6 +64,7 @@
6364
],
6465
"name": "My Client Name",
6566
"lastModified": 1468364444868,
66-
"approvals_deleted": true
67+
"approvals_deleted": true,
68+
"allowpublic": true
6769
}
6870
]

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_request.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"redirect_uri": [
4040
"http://test1.com",
4141
"http*://ant.path.wildcard/**/passback/*"
42-
]
42+
],
43+
"allowpublic": true
4344
}
4445
]

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_response.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
],
4444
"name": "My Client Name",
4545
"lastModified": 1474923482302,
46-
"approvals_deleted": true
46+
"approvals_deleted": true,
47+
"allowpublic": true
4748
},
4849
{
4950
"scope": [
@@ -78,6 +79,7 @@
7879
"my-saml-provider"
7980
],
8081
"name": "My Client Name",
82+
"allowpublic": true,
8183
"lastModified": 1474923482727
8284
}
8385
]

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_secret_response.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
],
3333
"name": "My Client Name",
3434
"lastModified": 1474923482301,
35-
"approvals_deleted": true
35+
"approvals_deleted": true,
36+
"allowpublic": true
3637
},
3738
{
3839
"scope": [
@@ -68,6 +69,7 @@
6869
],
6970
"name": "My Client Name",
7071
"lastModified": 1474923482302,
71-
"approvals_deleted": true
72+
"approvals_deleted": true,
73+
"allowpublic": true
7274
}
7375
]

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_request.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
],
1010
"autoapprove": [
1111
"clients.autoapprove"
12-
]
12+
],
13+
"allowpublic": true
1314
}

cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_response.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828
"my-saml-provider"
2929
],
3030
"name": "My Client Name",
31+
"allowpublic": true,
3132
"lastModified": 1468364443857
3233
}

cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ abstract class AbstractClient {
5454
@Nullable
5555
abstract Boolean getApprovalsDeleted();
5656

57+
/**
58+
* If true, allow to omit client_secret for authorization_code flow in combination with PKCE
59+
*/
60+
@JsonProperty("allowpublic")
61+
@Nullable
62+
abstract Boolean getAllowPublic();
63+
5764
/**
5865
* Scopes that the client is able to grant when creating a client
5966
*/

0 commit comments

Comments
 (0)