Change local development and ci to quarkus (#2115)
This commit is contained in:
parent
e486a189c0
commit
ca350380fb
24 changed files with 58 additions and 63 deletions
14
.github/workflows/cypress.yml
vendored
14
.github/workflows/cypress.yml
vendored
|
@ -47,19 +47,13 @@ jobs:
|
|||
working-directory: ${{ env.KEYCLOAK_SERVER_PATH }}
|
||||
run: |
|
||||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
echo "KEYCLOAK_SERVER_BIN=keycloak-server/distribution/server-dist/target/keycloak-$VERSION/bin" >> $GITHUB_ENV
|
||||
tar -xvf quarkus/dist/target/keycloak-$VERSION.tar.gz -C quarkus/dist/target/
|
||||
echo "KEYCLOAK_SERVER_BIN=keycloak-server/quarkus/dist/target/keycloak-$VERSION/bin" >> $GITHUB_ENV
|
||||
|
||||
- name: Start Keycloak Server
|
||||
working-directory: ${{ env.KEYCLOAK_SERVER_BIN }}
|
||||
run: |
|
||||
./add-user-keycloak.sh --user admin --password admin
|
||||
./standalone.sh -Dkeycloak.profile.feature.admin2=enabled -Dkeycloak.profile.feature.declarative_user_profile=enabled &
|
||||
|
||||
- name: Configure Keycloak Server
|
||||
working-directory: ${{ env.KEYCLOAK_SERVER_BIN }}
|
||||
run: |
|
||||
./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin
|
||||
./kcadm.sh update realms/master -s "adminTheme=keycloak.v2"
|
||||
KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./kc.sh start-dev -Dkeycloak.profile.feature.admin2=enabled -Dkeycloak.profile.feature.declarative_user_profile=enabled &
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v2
|
||||
|
@ -75,7 +69,7 @@ jobs:
|
|||
|
||||
- name: Run Cypress
|
||||
working-directory: ${{ env.ADMIN_UI_PATH }}
|
||||
run: CYPRESS_BASE_URL=http://localhost:8080/auth/admin/ CYPRESS_KEYCLOAK_SERVER=http://localhost:8080 npm run start:cypress-tests
|
||||
run: CYPRESS_BASE_URL=http://localhost:8080/admin/ CYPRESS_KEYCLOAK_SERVER=http://localhost:8080 npm run start:cypress-tests
|
||||
|
||||
- name: Add Cypress videos artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
|
@ -5,7 +5,7 @@ COPY . .
|
|||
|
||||
RUN mvn -f /app/keycloak-theme/pom.xml install
|
||||
|
||||
FROM quay.io/keycloak/keycloak:17.0.0-legacy
|
||||
COPY --from=builder /app/keycloak-theme/target/classes /opt/jboss/keycloak/themes/keycloak.v2
|
||||
FROM quay.io/keycloak/keycloak:17.0.0
|
||||
COPY --from=builder /app/keycloak-theme/target/keycloak-admin-ui*.jar /opt/jboss/keycloak/lib/lib/main/
|
||||
|
||||
EXPOSE 8080
|
||||
|
|
|
@ -88,7 +88,7 @@ describe("Client authentication subtab", () => {
|
|||
authenticationTab.goToPolicySubTab();
|
||||
cy.intercept(
|
||||
"GET",
|
||||
"/auth/admin/realms/master/clients/*/authz/resource-server/policy/regex/*"
|
||||
"/admin/realms/master/clients/*/authz/resource-server/policy/regex/*"
|
||||
).as("get");
|
||||
authenticationTab
|
||||
.goToCreatePolicy("regex")
|
||||
|
@ -117,7 +117,7 @@ describe("Client authentication subtab", () => {
|
|||
authenticationTab.goToPolicySubTab();
|
||||
cy.intercept(
|
||||
"GET",
|
||||
"/auth/admin/realms/master/clients/*/authz/resource-server/policy/client/*"
|
||||
"/admin/realms/master/clients/*/authz/resource-server/policy/client/*"
|
||||
).as("get");
|
||||
authenticationTab
|
||||
.goToCreatePolicy("client")
|
||||
|
|
|
@ -28,6 +28,7 @@ describe("Client Scopes test", () => {
|
|||
"Are you sure you want to delete this client scope";
|
||||
const notificationMessageDeletionConfirmation =
|
||||
"The client scope has been deleted";
|
||||
|
||||
const clientScopeName = "client-scope-test";
|
||||
const openIDConnectItemText = "OpenID Connect";
|
||||
const clientScope = {
|
||||
|
@ -324,9 +325,8 @@ describe("Client Scopes test", () => {
|
|||
describe("Scope test", () => {
|
||||
const scopeTab = new RoleMappingTab();
|
||||
const scopeName = "address";
|
||||
|
||||
it("Assign role", () => {
|
||||
const role = "offline_access";
|
||||
const role = "admin";
|
||||
listingPage.searchItem(scopeName, false).goToItemDetails(scopeName);
|
||||
scopeTab.goToScopeTab().assignRole().selectRow(role).assign();
|
||||
masthead.checkNotificationMessage("Role mapping updated");
|
||||
|
|
|
@ -93,7 +93,7 @@ describe("Clients SAML tests", () => {
|
|||
|
||||
it("disable client signature", () => {
|
||||
cy.intercept(
|
||||
"auth/admin/realms/master/clients/*/certificates/saml.signing"
|
||||
"admin/realms/master/clients/*/certificates/saml.signing"
|
||||
).as("load");
|
||||
cy.findByTestId("clientSignature").click({ force: true });
|
||||
cy.waitFor("@load");
|
||||
|
|
|
@ -70,7 +70,7 @@ describe("Clients test", () => {
|
|||
keycloakBefore();
|
||||
loginPage.logIn();
|
||||
sidebarPage.goToClients();
|
||||
cy.intercept("/auth/admin/realms/master/clients/*").as("fetchClient");
|
||||
cy.intercept("/admin/realms/master/clients/*").as("fetchClient");
|
||||
listingPage.searchItem(clientId).goToItemDetails(clientId);
|
||||
cy.wait("@fetchClient");
|
||||
clientScopesTab.goToClientScopesTab();
|
||||
|
@ -569,7 +569,7 @@ describe("Clients test", () => {
|
|||
bearerOnly: true,
|
||||
});
|
||||
sidebarPage.goToClients();
|
||||
cy.intercept("/auth/admin/realms/master/clients/*").as("fetchClient");
|
||||
cy.intercept("/admin/realms/master/clients/*").as("fetchClient");
|
||||
listingPage.searchItem(clientId).goToItemDetails(clientId);
|
||||
cy.wait("@fetchClient");
|
||||
});
|
||||
|
|
|
@ -22,8 +22,8 @@ describe("OIDC identity provider test", () => {
|
|||
const deleteSuccessMsg = "Provider successfully deleted";
|
||||
|
||||
const keycloakServer = Cypress.env("KEYCLOAK_SERVER");
|
||||
const discoveryUrl = `${keycloakServer}/auth/realms/master/.well-known/openid-configuration`;
|
||||
const authorizationUrl = `${keycloakServer}/auth/realms/master/protocol/openid-connect/auth`;
|
||||
const discoveryUrl = `${keycloakServer}/realms/master/.well-known/openid-configuration`;
|
||||
const authorizationUrl = `${keycloakServer}/realms/master/protocol/openid-connect/auth`;
|
||||
|
||||
describe("OIDC Identity provider creation", () => {
|
||||
const identityProviderName = "github";
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Identity provider test", () => {
|
|||
const deleteSuccessMsg = "Provider successfully deleted";
|
||||
|
||||
const keycloakServer = Cypress.env("KEYCLOAK_SERVER");
|
||||
const samlDiscoveryUrl = `${keycloakServer}/auth/realms/master/protocol/saml/descriptor`;
|
||||
const samlDiscoveryUrl = `${keycloakServer}/realms/master/protocol/saml/descriptor`;
|
||||
|
||||
describe("SAML identity provider creation", () => {
|
||||
const identityProviderName = "github";
|
||||
|
|
|
@ -59,7 +59,7 @@ describe("Realm roles test", () => {
|
|||
masthead.checkNotificationMessage("Role created", true);
|
||||
sidebarPage.goToRealmRoles();
|
||||
|
||||
const fetchUrl = "/auth/admin/realms/master/roles?first=0&max=11";
|
||||
const fetchUrl = "/admin/realms/master/roles?first=0&max=11";
|
||||
cy.intercept(fetchUrl).as("fetch");
|
||||
|
||||
listingPage.deleteItem(itemId);
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("Realm settings client policies tab tests", () => {
|
|||
});
|
||||
|
||||
it("Complete new client form and submit", () => {
|
||||
const url = `/auth/admin/realms/${realmName}/client-policies/policies`;
|
||||
const url = `/admin/realms/${realmName}/client-policies/policies`;
|
||||
cy.intercept("PUT", url).as("save");
|
||||
|
||||
realmSettingsPage.createNewClientPolicyFromEmptyState(
|
||||
|
@ -135,7 +135,7 @@ describe("Realm settings client policies tab tests", () => {
|
|||
});
|
||||
|
||||
it("Should not create duplicate client profile", () => {
|
||||
const url = `/auth/admin/realms/${realmName}/client-policies/policies`;
|
||||
const url = `admin/realms/${realmName}/client-policies/policies`;
|
||||
cy.intercept("PUT", url).as("save");
|
||||
|
||||
realmSettingsPage.createNewClientPolicyFromEmptyState(
|
||||
|
@ -172,7 +172,7 @@ describe("Realm settings client policies tab tests", () => {
|
|||
});
|
||||
|
||||
it("Check deleting newly created client policy from create view via dropdown", () => {
|
||||
const url = `/auth/admin/realms/${realmName}/client-policies/policies`;
|
||||
const url = `admin/realms/${realmName}/client-policies/policies`;
|
||||
cy.intercept("PUT", url).as("save");
|
||||
realmSettingsPage.createNewClientPolicyFromEmptyState(
|
||||
"Test again",
|
||||
|
|
|
@ -52,7 +52,7 @@ describe("Realm settings client profiles tab tests", () => {
|
|||
});
|
||||
|
||||
it("Complete new client form and submit", () => {
|
||||
const url = `/auth/admin/realms/${realmName}/client-policies/profiles`;
|
||||
const url = `admin/realms/${realmName}/client-policies/profiles`;
|
||||
cy.intercept("PUT", url).as("save");
|
||||
realmSettingsPage
|
||||
.createClientProfile(profileName, "Test Description")
|
||||
|
@ -78,7 +78,7 @@ describe("Realm settings client profiles tab tests", () => {
|
|||
});
|
||||
|
||||
it("Should not create duplicate client profile", () => {
|
||||
const url = `/auth/admin/realms/${realmName}/client-policies/profiles`;
|
||||
const url = `admin/realms/${realmName}/client-policies/profiles`;
|
||||
cy.intercept("PUT", url).as("save");
|
||||
realmSettingsPage
|
||||
.createClientProfile(profileName, "Test Description")
|
||||
|
|
|
@ -32,7 +32,7 @@ describe("Realm settings events tab tests", () => {
|
|||
});
|
||||
|
||||
const goToDetails = () => {
|
||||
const keysUrl = `/auth/admin/realms/${realmName}/keys`;
|
||||
const keysUrl = `/admin/realms/${realmName}/keys`;
|
||||
cy.intercept(keysUrl).as("keysFetch");
|
||||
|
||||
cy.findByTestId("rs-keys-tab").click();
|
||||
|
@ -77,7 +77,7 @@ describe("Realm settings events tab tests", () => {
|
|||
};
|
||||
|
||||
const goToKeys = () => {
|
||||
const keysUrl = `/auth/admin/realms/${realmName}/keys`;
|
||||
const keysUrl = `/admin/realms/${realmName}/keys`;
|
||||
cy.intercept(keysUrl).as("keysFetch");
|
||||
cy.findByTestId("rs-keys-tab").click();
|
||||
cy.findByTestId("rs-keys-list-tab").click();
|
||||
|
@ -96,9 +96,7 @@ describe("Realm settings events tab tests", () => {
|
|||
};
|
||||
|
||||
it("Enable user events", () => {
|
||||
cy.intercept("GET", `/auth/admin/realms/${realmName}/events/config`).as(
|
||||
"load"
|
||||
);
|
||||
cy.intercept("GET", `/admin/realms/${realmName}/events/config`).as("load");
|
||||
sidebarPage.goToRealmSettings();
|
||||
cy.findByTestId("rs-realm-events-tab").click();
|
||||
cy.findByTestId("rs-events-tab").click();
|
||||
|
@ -115,7 +113,7 @@ describe("Realm settings events tab tests", () => {
|
|||
.confirmModal();
|
||||
masthead.checkNotificationMessage("The user events have been cleared");
|
||||
const events = ["Client info", "Client info error"];
|
||||
cy.intercept("GET", `/auth/admin/realms/${realmName}/events/config`).as(
|
||||
cy.intercept("GET", `/admin/realms/${realmName}/events/config`).as(
|
||||
"fetchConfig"
|
||||
);
|
||||
realmSettingsPage.addUserEvents(events).clickAdd();
|
||||
|
|
|
@ -58,7 +58,7 @@ describe("Realms test", () => {
|
|||
sidebarPage.goToCreateRealm();
|
||||
createRealmPage.fillRealmName(newRealmName).createRealm();
|
||||
|
||||
const fetchUrl = "/auth/admin/realms?briefRepresentation=true";
|
||||
const fetchUrl = "/admin/realms?briefRepresentation=true";
|
||||
cy.intercept(fetchUrl).as("fetch");
|
||||
|
||||
masthead.checkNotificationMessage("Realm created");
|
||||
|
|
|
@ -156,7 +156,7 @@ describe("User creation", () => {
|
|||
listingPage.searchItem(itemId).itemExist(itemId);
|
||||
listingPage.goToItemDetails(itemId);
|
||||
|
||||
cy.intercept("PUT", `/auth/admin/realms/master/users/*`).as("save-user");
|
||||
cy.intercept("PUT", `/admin/realms/master/users/*`).as("save-user");
|
||||
|
||||
const attributeKey = "key-multiple";
|
||||
attributesTab
|
||||
|
|
|
@ -84,7 +84,7 @@ export default class ListingPage {
|
|||
|
||||
searchItem(searchValue: string, wait = true) {
|
||||
if (wait) {
|
||||
const searchUrl = `/auth/admin/realms/master/*${searchValue}*`;
|
||||
const searchUrl = `/admin/realms/master/*${searchValue}*`;
|
||||
cy.intercept(searchUrl).as("search");
|
||||
}
|
||||
|
||||
|
@ -289,7 +289,7 @@ export default class ListingPage {
|
|||
}
|
||||
|
||||
changeTypeToOfSelectedItems(assignedType: FilterAssignedType) {
|
||||
cy.intercept("/auth/admin/realms/master/client-scopes").as("load");
|
||||
cy.intercept("/admin/realms/master/client-scopes").as("load");
|
||||
cy.get(this.toolbarChangeType).click();
|
||||
cy.get(this.itemRowSelectItem).contains(assignedType).click();
|
||||
cy.wait("@load");
|
||||
|
|
|
@ -45,7 +45,7 @@ export default class AdminEventsTab {
|
|||
cy.findByTestId(this.searchAdminEventDrpDwnBtn).click();
|
||||
cy.findByTestId(this.resourcePathInputFld).type("events/config");
|
||||
|
||||
cy.intercept("/auth/admin/realms/master/admin-events*").as("eventsFetch");
|
||||
cy.intercept("/admin/realms/master/admin-events*").as("eventsFetch");
|
||||
cy.findByTestId(this.searchEventsBtn).click();
|
||||
cy.wait("@eventsFetch");
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ export default class UserEventsTab {
|
|||
cy.get(this.eventTypeInputFld).type("LOGOUT");
|
||||
cy.get(this.eventTypeOption).contains("LOGOUT").click();
|
||||
|
||||
cy.intercept("/auth/admin/realms/master/events*").as("eventsFetch");
|
||||
cy.intercept("/admin/realms/master/events*").as("eventsFetch");
|
||||
cy.findByTestId(this.searchEventsBtn).click();
|
||||
cy.wait("@eventsFetch");
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ export default class RealmSettingsPage {
|
|||
}
|
||||
|
||||
toggleAddProviderDropdown() {
|
||||
const keysUrl = `/auth/admin/realms/${this.realmName}/keys`;
|
||||
const keysUrl = `/admin/realms/${this.realmName}/keys`;
|
||||
cy.intercept(keysUrl).as("keysFetch");
|
||||
cy.findByTestId(this.addProviderDropdown).click();
|
||||
|
||||
|
@ -750,7 +750,7 @@ export default class RealmSettingsPage {
|
|||
|
||||
openProfileDetails(name: string) {
|
||||
cy.intercept(
|
||||
`/auth/admin/realms/${this.realmName}/client-policies/profiles*`
|
||||
`/admin/realms/${this.realmName}/client-policies/profiles*`
|
||||
).as("profilesFetch");
|
||||
cy.get(
|
||||
'a[href*="realm-settings/clientPolicies/' + name + '/edit-profile"]'
|
||||
|
@ -761,7 +761,7 @@ export default class RealmSettingsPage {
|
|||
|
||||
editExecutor(availablePeriod?: number) {
|
||||
cy.intercept(
|
||||
`/auth/admin/realms/${this.realmName}/client-policies/profiles*`
|
||||
`/admin/realms/${this.realmName}/client-policies/profiles*`
|
||||
).as("profilesFetch");
|
||||
cy.get(this.editExecutorBtn).click();
|
||||
cy.wait("@profilesFetch");
|
||||
|
|
|
@ -9,7 +9,7 @@ import { merge } from "lodash-es";
|
|||
|
||||
class AdminClient {
|
||||
private readonly client = new KeycloakAdminClient({
|
||||
baseUrl: `${Cypress.env("KEYCLOAK_SERVER")}/auth`,
|
||||
baseUrl: Cypress.env("KEYCLOAK_SERVER"),
|
||||
realmName: "master",
|
||||
});
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ const consoleClientConfig = JSON.parse(
|
|||
);
|
||||
|
||||
const adminClient = new KcAdminClient.default({
|
||||
baseUrl: "http://localhost:8180/auth",
|
||||
baseUrl: "http://localhost:8180",
|
||||
realmName: "master",
|
||||
});
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export default {
|
|||
],
|
||||
routes: [
|
||||
{
|
||||
src: "/auth/admin/.*",
|
||||
src: "/admin/.*",
|
||||
dest: (req, res) =>
|
||||
proxy.web(req, res, {
|
||||
hostname: "localhost",
|
||||
|
|
|
@ -25,9 +25,9 @@ const realm =
|
|||
// The default environment, used during development.
|
||||
const defaultEnvironment: Environment = {
|
||||
loginRealm: realm,
|
||||
authServerUrl: "http://localhost:8180/auth",
|
||||
authUrl: "http://localhost:8180/auth",
|
||||
consoleBaseUrl: "/auth/admin/master/console/",
|
||||
authServerUrl: "http://localhost:8180",
|
||||
authUrl: "http://localhost:8180",
|
||||
consoleBaseUrl: "/admin/master/console/",
|
||||
resourceUrl: ".",
|
||||
masterRealm: "master",
|
||||
resourceVersion: "unknown",
|
||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
|||
useJwksUrl:
|
||||
"If the switch is on, identity provider public keys will be downloaded from given JWKS URL. This allows great flexibility because new keys will be always re-downloaded again when identity provider generates new keypair. If the switch is off, public key (or certificate) from the Keycloak DB is used, so when the identity provider keypair changes, you always need to import the new key to the Keycloak DB as well.",
|
||||
jwksUrl:
|
||||
"URL where identity provider keys in JWK format are stored. See JWK specification for more details. If you use external Keycloak identity provider, you can use URL like 'http://broker-keycloak:8180/auth/realms/test/protocol/openid-connect/certs' assuming your brokered Keycloak is running on 'http://broker-keycloak:8180' and its realm is 'test' .",
|
||||
"URL where identity provider keys in JWK format are stored. See JWK specification for more details. If you use external Keycloak identity provider, you can use URL like 'http://broker-keycloak:8180/realms/test/protocol/openid-connect/certs' assuming your brokered Keycloak is running on 'http://broker-keycloak:8180' and its realm is 'test' .",
|
||||
allowedClockSkew:
|
||||
"Clock skew in seconds that is tolerated when validating identity provider tokens. Default value is zero.",
|
||||
attributeConsumingServiceIndex:
|
||||
|
|
25
start.mjs
25
start.mjs
|
@ -58,22 +58,25 @@ async function decompressKeycloak() {
|
|||
}
|
||||
|
||||
const run = () => {
|
||||
const addProc = spawn(
|
||||
path.join(serverPath, "bin", `add-user-keycloak${extension}`),
|
||||
["--user", "admin", "--password", "admin"]
|
||||
);
|
||||
|
||||
addProc.on("exit", () => {
|
||||
const proc = spawn(path.join(serverPath, "bin", `standalone${extension}`), [
|
||||
"-Djboss.socket.binding.port-offset=100",
|
||||
const proc = spawn(
|
||||
path.join(serverPath, "bin", `kc${extension}`),
|
||||
[
|
||||
"start-dev",
|
||||
"--http-port=8180",
|
||||
"-Dkeycloak.profile.feature.admin2=enabled",
|
||||
"-Dkeycloak.profile.feature.declarative_user_profile=enabled",
|
||||
...args,
|
||||
]);
|
||||
],
|
||||
{
|
||||
env: {
|
||||
KEYCLOAK_ADMIN: "admin",
|
||||
KEYCLOAK_ADMIN_PASSWORD: "admin",
|
||||
},
|
||||
}
|
||||
);
|
||||
proc.stdout.on("data", (data) => {
|
||||
console.log(data.toString());
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const request = (url, file, progressBar) => {
|
||||
|
@ -110,7 +113,7 @@ if (!fs.existsSync(fileName)) {
|
|||
});
|
||||
|
||||
request(
|
||||
`https://github.com/keycloak/keycloak/releases/download/${version}/keycloak-legacy-${version}.tar.gz`,
|
||||
`https://github.com/keycloak/keycloak/releases/download/${version}/keycloak-${version}.tar.gz`,
|
||||
file,
|
||||
progressBar
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue