Skip to content

Commit

Permalink
Merge branch 'main' into userprofile-shared
Browse files Browse the repository at this point in the history
  • Loading branch information
edewit authored Oct 17, 2023
2 parents 836262d + 0d008df commit 75aef6c
Show file tree
Hide file tree
Showing 134 changed files with 1,580 additions and 815 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
* @version $Revision: 1 $
*/
public class JsonWebToken implements Serializable, Token {
public static final String AZP = "azp";
public static final String SUBJECT = "sub";

@JsonProperty("jti")
protected String id;

Expand All @@ -53,11 +56,11 @@ public class JsonWebToken implements Serializable, Token {
@JsonSerialize(using = StringOrArraySerializer.class)
@JsonDeserialize(using = StringOrArrayDeserializer.class)
protected String[] audience;
@JsonProperty("sub")
@JsonProperty(SUBJECT)
protected String subject;
@JsonProperty("typ")
protected String type;
@JsonProperty("azp")
@JsonProperty(AZP)
public String issuedFor;
protected Map<String, Object> otherClaims = new HashMap<>();

Expand Down Expand Up @@ -184,7 +187,7 @@ public JsonWebToken iat(Long iat) {
this.iat = iat;
return this;
}

/**
* @deprecated int will overflow with values after 2038. Use {@link #iat(Long)} ()} instead.
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/server_admin/topics/vault.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ All built-in providers support the configuration of key resolvers. A key resolve

[source,bash]
----
kc.[sh.bat] start --spi-vault-file-key-resolvers=REALM_UNDERSCORE_KEY,KEY_ONLY
kc.[sh|bat] start --spi-vault-file-key-resolvers=REALM_UNDERSCORE_KEY,KEY_ONLY
----

The resolvers run in the same order you declare them in the configuration. For each resolver, {project_name} uses the last entry name the resolver produces, which combines the realm with the vault key to search for the vault's secret. If {project_name} finds a secret, it returns the secret. If not, {project_name} uses the next resolver. This search continues until {project_name} finds a non-empty secret or runs out of resolvers. If {project_name} finds no secret, {project_name} returns an empty secret.
Expand Down
4 changes: 2 additions & 2 deletions js/apps/account-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.47.0",
"react-i18next": "^13.2.2",
"react-i18next": "^13.3.0",
"react-router-dom": "^6.15.0",
"ui-shared": "workspace:*"
},
"devDependencies": {
"@keycloak/keycloak-admin-client": "workspace:*",
"@playwright/test": "^1.38.1",
"@playwright/test": "^1.39.0",
"@types/lodash-es": "^4.17.9",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,54 +1,41 @@
export default class SessionsPage {
sessionTypeList = ".pf-c-select__toggle + ul";
allSessionTypesOption = "all-sessions-option";
regularSSOOption = "regular-sso-option";
offlineOption = "offline-option";
directGrantOption = "direct-grant-option";
serviceAccountOption = "service-account-option";
selectedType = ".pf-c-select__toggle-text";
revocationActionItem = "revocation";
setToNowButton = "set-to-now-button";
actionDropdown = "action-dropdown";
clearNotBeforeButton = "clear-not-before-button";
pushButton = "modal-test-connection-button";
notBeforeInput = "not-before-input";
logoutAll = "logout-all";
logoutAllConfirm = "confirm";
#revocationActionItem = "revocation";
#setToNowButton = "set-to-now-button";
#actionDropdown = "action-dropdown";
#clearNotBeforeButton = "clear-not-before-button";
#pushButton = "modal-test-connection-button";
#notBeforeInput = "not-before-input";

setToNow() {
cy.findByTestId(this.actionDropdown).should("exist").click();
cy.findByTestId(this.revocationActionItem).should("exist").click();
cy.findByTestId(this.setToNowButton).should("exist").click();
this.#openRevocationDialog();
cy.findByTestId(this.#setToNowButton).click();
Cypress.session.clearAllSavedSessions();
}

checkNotBeforeValueExists() {
cy.findByTestId(this.actionDropdown).should("exist").click();
cy.findByTestId(this.revocationActionItem).should("exist").click();
cy.findByTestId(this.notBeforeInput).should("not.have.value", "None");
this.#openRevocationDialog();
cy.findByTestId(this.#notBeforeInput).should("not.have.value", "None");
}

clearNotBefore() {
cy.findByTestId(this.actionDropdown).should("exist").click();
cy.findByTestId(this.revocationActionItem).should("exist").click();
cy.findByTestId(this.clearNotBeforeButton).should("exist").click();
this.#openRevocationDialog();
cy.findByTestId(this.#clearNotBeforeButton).click();
}

checkNotBeforeCleared() {
cy.findByTestId(this.actionDropdown).should("exist").click();
cy.findByTestId(this.revocationActionItem).should("exist").click();
cy.findByTestId(this.notBeforeInput).should("have.value", "None");
this.#openRevocationDialog();
cy.findByTestId(this.#notBeforeInput).should("have.value", "None");
}

logoutAllSessions() {
cy.findByTestId(this.actionDropdown).should("exist").click();
cy.findByTestId(this.logoutAll).should("exist").click();
cy.findByTestId(this.logoutAllConfirm).should("exist").click();
pushRevocation() {
this.#openRevocationDialog();
cy.findByTestId(this.#pushButton).click();
}

pushRevocation() {
cy.findByTestId(this.actionDropdown).should("exist").click();
cy.findByTestId(this.revocationActionItem).should("exist").click();
cy.findByTestId(this.pushButton).should("exist").click();
#openRevocationDialog() {
cy.findByTestId(this.#actionDropdown).click();
cy.intercept("/admin/realms/master").as("fetchRealm");
cy.findByTestId(this.#revocationActionItem).click();
cy.wait("@fetchRealm");
}
}
6 changes: 3 additions & 3 deletions js/apps/admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
"react-dropzone": "^14.2.3",
"react-error-boundary": "^3.1.4",
"react-hook-form": "^7.47.0",
"react-i18next": "^13.2.2",
"react-i18next": "^13.3.0",
"react-router-dom": "^6.15.0",
"reactflow": "^11.9.3",
"reactflow": "^11.9.4",
"ui-shared": "workspace:*",
"use-react-router-breadcrumbs": "^4.0.1"
},
Expand All @@ -100,7 +100,7 @@
"@types/react-dom": "^18.2.13",
"@types/uuid": "^9.0.5",
"@vitejs/plugin-react-swc": "^3.4.0",
"cypress": "^13.3.0",
"cypress": "^13.3.1",
"cypress-axe": "^1.5.0",
"jsdom": "^22.1.0",
"ldap-server-mock": "^6.0.1",
Expand Down
4 changes: 4 additions & 0 deletions js/apps/admin-ui/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3097,6 +3097,10 @@
"label": "Add to userinfo",
"tooltip": "Should the claim be added to the userinfo?"
},
"includeInIntrospection": {
"label": "Add to token introspection",
"tooltip": "Should the claim be added to the token introspection?"
},
"sectorIdentifierUri": {
"label": "Sector Identifier URI",
"tooltip": "Providers that use pairwise sub values and support Dynamic Client Registration SHOULD use the sector_identifier_uri parameter. It provides a way for a group of websites under common administrative control to have consistent pairwise sub values independent of the individual domain names. It also provides a way for Clients to change redirect_uri domains without having to reregister all their users."
Expand Down
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/authentication/routes/Authentication.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type AuthenticationTab = "flows" | "required-actions" | "policies";
Expand Down Expand Up @@ -31,6 +31,6 @@ export const toAuthentication = (
: AuthenticationRoute.path;

return {
pathname: generatePath(path, params),
pathname: generateEncodedPath(path, params),
};
};
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/authentication/routes/CreateFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type CreateFlowParams = { realm: string };
Expand All @@ -17,5 +17,5 @@ export const CreateFlowRoute: AppRouteObject = {
};

export const toCreateFlow = (params: CreateFlowParams): Partial<Path> => ({
pathname: generatePath(CreateFlowRoute.path, params),
pathname: generateEncodedPath(CreateFlowRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/authentication/routes/Flow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type FlowParams = {
Expand Down Expand Up @@ -30,6 +30,6 @@ export const toFlow = (params: FlowParams): Partial<Path> => {
const path = params.builtIn ? FlowWithBuiltInRoute.path : FlowRoute.path;

return {
pathname: generatePath(path, params),
pathname: generateEncodedPath(path, params),
};
};
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/client-scopes/routes/ClientScope.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientScopeTab = "settings" | "mappers" | "scope";
Expand All @@ -26,6 +26,6 @@ export const toClientScope = (params: ClientScopeParams): Partial<Path> => {
const path = ClientScopeRoute.path;

return {
pathname: generatePath(path, params),
pathname: generateEncodedPath(path, params),
};
};
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/client-scopes/routes/ClientScopes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientScopesParams = { realm: string };
Expand All @@ -17,5 +17,5 @@ export const ClientScopesRoute: AppRouteObject = {
};

export const toClientScopes = (params: ClientScopesParams): Partial<Path> => ({
pathname: generatePath(ClientScopesRoute.path, params),
pathname: generateEncodedPath(ClientScopesRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/client-scopes/routes/Mapper.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type MapperParams = {
Expand All @@ -21,5 +21,5 @@ export const MapperRoute: AppRouteObject = {
};

export const toMapper = (params: MapperParams): Partial<Path> => ({
pathname: generatePath(MapperRoute.path, params),
pathname: generateEncodedPath(MapperRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/client-scopes/routes/NewClientScope.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type NewClientScopeParams = { realm: string };
Expand All @@ -19,5 +19,5 @@ export const NewClientScopeRoute: AppRouteObject = {
export const toNewClientScope = (
params: NewClientScopeParams,
): Partial<Path> => ({
pathname: generatePath(NewClientScopeRoute.path, params),
pathname: generateEncodedPath(NewClientScopeRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/AddClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type AddClientParams = { realm: string };
Expand All @@ -17,5 +17,5 @@ export const AddClientRoute: AppRouteObject = {
};

export const toAddClient = (params: AddClientParams): Partial<Path> => ({
pathname: generatePath(AddClientRoute.path, params),
pathname: generateEncodedPath(AddClientRoute.path, params),
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";
import { ClientRegistrationTab } from "./ClientRegistration";

Expand Down Expand Up @@ -35,6 +35,6 @@ export const toRegistrationProvider = (
: AddRegistrationProviderRoute.path;

return {
pathname: generatePath(path, params),
pathname: generateEncodedPath(path, params),
};
};
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/AuthenticationTab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type AuthorizationTab =
Expand Down Expand Up @@ -32,5 +32,5 @@ export const AuthorizationRoute: AppRouteObject = {
export const toAuthorizationTab = (
params: AuthorizationParams,
): Partial<Path> => ({
pathname: generatePath(AuthorizationRoute.path, params),
pathname: generateEncodedPath(AuthorizationRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/Client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientTab =
Expand Down Expand Up @@ -34,5 +34,5 @@ export const ClientRoute: AppRouteObject = {
};

export const toClient = (params: ClientParams): Partial<Path> => ({
pathname: generatePath(ClientRoute.path, params),
pathname: generateEncodedPath(ClientRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/ClientRegistration.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientRegistrationTab = "anonymous" | "authenticated";
Expand All @@ -24,5 +24,5 @@ export const ClientRegistrationRoute: AppRouteObject = {
export const toClientRegistration = (
params: ClientRegistrationParams,
): Partial<Path> => ({
pathname: generatePath(ClientRegistrationRoute.path, params),
pathname: generateEncodedPath(ClientRegistrationRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/ClientRole.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientRoleTab =
Expand Down Expand Up @@ -28,5 +28,5 @@ export const ClientRoleRoute: AppRouteObject = {
} satisfies AppRouteObject;

export const toClientRole = (params: ClientRoleParams): Partial<Path> => ({
pathname: generatePath(ClientRoleRoute.path, params),
pathname: generateEncodedPath(ClientRoleRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/ClientScopeTab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientScopesTab = "setup" | "evaluate";
Expand All @@ -25,5 +25,5 @@ export const ClientScopesRoute: AppRouteObject = {
export const toClientScopesTab = (
params: ClientScopesParams,
): Partial<Path> => ({
pathname: generatePath(ClientScopesRoute.path, params),
pathname: generateEncodedPath(ClientScopesRoute.path, params),
});
4 changes: 2 additions & 2 deletions js/apps/admin-ui/src/clients/routes/Clients.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from "react";
import type { Path } from "react-router-dom";
import { generatePath } from "react-router-dom";
import { generateEncodedPath } from "../../utils/generateEncodedPath";
import type { AppRouteObject } from "../../routes";

export type ClientsTab =
Expand Down Expand Up @@ -33,6 +33,6 @@ export const toClients = (params: ClientsParams): Partial<Path> => {
const path = params.tab ? ClientsRouteWithTab.path : ClientsRoute.path;

return {
pathname: generatePath(path, params),
pathname: generateEncodedPath(path, params),
};
};
Loading

0 comments on commit 75aef6c

Please sign in to comment.