Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jans auth server client registration language metadata #1237

Merged
merged 20 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5e592f8
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 6, 2022
ebd1c5f
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 6, 2022
055e4df
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k Apr 7, 2022
0af9229
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 7, 2022
1699225
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 18, 2022
c3bca57
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k Apr 18, 2022
7313f96
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k Apr 19, 2022
6612b1f
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 25, 2022
7d603ba
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 25, 2022
acf6bb3
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 26, 2022
82cdfd3
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k Apr 26, 2022
8dab44e
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 27, 2022
17e5f78
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 27, 2022
5a5ab46
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 27, 2022
9af2ff1
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 27, 2022
afb10f5
feat(jans-auth-server): auth server should support client registratio…
qbert2k Apr 27, 2022
e15f106
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k May 5, 2022
6e2cd7b
fix sonar: duplicated lines
qbert2k May 10, 2022
0052275
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k May 11, 2022
a01691d
Merge remote-tracking branch 'origin/main' into jans-auth-server-clie…
qbert2k May 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(jans-auth-server): auth server should support client registratio…
…n language metadata

Signed-off-by: Javier Rojas Blum <javier.rojas.blum@gmail.com>
  • Loading branch information
qbert2k committed Apr 7, 2022
commit 0af9229eda91473a74b9043be97e655c4f91d948
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,18 @@ public JSONObject getJSONObject(Client client) throws JSONException, StringEncry
responseJsonObject.put(CLIENT_SECRET_EXPIRES_AT.toString(), client.getClientSecretExpiresAt() != null && client.getClientSecretExpiresAt().getTime() > 0 ?
client.getClientSecretExpiresAt().getTime() / 1000 : 0);

Util.addToJSONObjectIfNotNull(responseJsonObject, CLIENT_NAME.toString(), client.getClientName());
Util.addToJSONObjectIfNotNull(responseJsonObject, LOGO_URI.toString(), client.getLogoUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, CLIENT_URI.toString(), client.getClientUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, POLICY_URI.toString(), client.getPolicyUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, TOS_URI.toString(), client.getTosUri());

Util.addToJSONObjectIfNotNull(responseJsonObject, REDIRECT_URIS.toString(), client.getRedirectUris());
Util.addToJSONObjectIfNotNull(responseJsonObject, CLAIMS_REDIRECT_URIS.toString(), client.getClaimRedirectUris());
Util.addToJSONObjectIfNotNull(responseJsonObject, RESPONSE_TYPES.toString(), ResponseType.toStringArray(client.getResponseTypes()));
Util.addToJSONObjectIfNotNull(responseJsonObject, GRANT_TYPES.toString(), GrantType.toStringArray(client.getGrantTypes()));
Util.addToJSONObjectIfNotNull(responseJsonObject, APPLICATION_TYPE.toString(), client.getApplicationType());
Util.addToJSONObjectIfNotNull(responseJsonObject, CONTACTS.toString(), client.getContacts());
Util.addToJSONObjectIfNotNull(responseJsonObject, CLIENT_NAME.toString(), client.getClientName());
Util.addToJSONObjectIfNotNull(responseJsonObject, LOGO_URI.toString(), client.getLogoUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, CLIENT_URI.toString(), client.getClientUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, POLICY_URI.toString(), client.getPolicyUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, TOS_URI.toString(), client.getTosUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, JWKS_URI.toString(), client.getJwksUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, SECTOR_IDENTIFIER_URI.toString(), client.getSectorIdentifierUri());
Util.addToJSONObjectIfNotNull(responseJsonObject, SUBJECT_TYPE.toString(), client.getSubjectType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
import javax.inject.Named;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;

import static io.jans.as.model.util.StringUtils.toList;
import static org.apache.commons.lang3.BooleanUtils.isTrue;
Expand Down Expand Up @@ -103,9 +99,6 @@ public void updateClientFromRequestObject(Client client, RegisterRequest request
if (requestObject.getApplicationType() != null) {
client.setApplicationType(requestObject.getApplicationType());
}
if (StringUtils.isNotBlank(requestObject.getClientName())) {
client.setClientName(requestObject.getClientName());
}
if (StringUtils.isNotBlank(requestObject.getSectorIdentifierUri())) {
client.setSectorIdentifierUri(requestObject.getSectorIdentifierUri());
}
Expand Down Expand Up @@ -153,18 +146,23 @@ public void updateClientFromRequestObject(Client client, RegisterRequest request
contacts = new ArrayList<>(new HashSet<>(contacts)); // Remove repeated elements
client.setContacts(contacts.toArray(new String[0]));
}
if (StringUtils.isNotBlank(requestObject.getLogoUri())) {
client.setLogoUri(requestObject.getLogoUri());

for (String key : requestObject.getClientNameLanguageTags()) {
client.setClientName(requestObject.getClientName(key), Locale.forLanguageTag(key));
}
for (String key : requestObject.getLogoUriLanguageTags()) {
client.setLogoUri(requestObject.getLogoUri(key), Locale.forLanguageTag(key));
}
if (StringUtils.isNotBlank(requestObject.getClientUri())) {
client.setClientUri(requestObject.getClientUri());
for (String key : requestObject.getClientUriLanguageTags()) {
client.setClientUri(requestObject.getClientUri(key), Locale.forLanguageTag(key));
}
if (StringUtils.isNotBlank(requestObject.getPolicyUri())) {
client.setPolicyUri(requestObject.getPolicyUri());
for (String key : requestObject.getPolicyUriLanguageTags()) {
client.setPolicyUri(requestObject.getPolicyUri(key), Locale.forLanguageTag(key));
}
if (StringUtils.isNotBlank(requestObject.getTosUri())) {
client.setTosUri(requestObject.getTosUri());
for (String key : requestObject.getTosUriLanguageTags()) {
client.setTosUri(requestObject.getTosUri(key), Locale.forLanguageTag(key));
}

if (StringUtils.isNotBlank(requestObject.getJwksUri())) {
client.setJwksUri(requestObject.getJwksUri());
}
Expand Down