forked from dani-garcia/vaultwarden
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Group/Organization mapping to trigger invitation
- Loading branch information
Showing
18 changed files
with
456 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM registry.access.redhat.com/ubi9 AS ubi-micro-build | ||
|
||
RUN dnf install -y wget && wget -O /root/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 && chmod +x /root/jq | ||
|
||
FROM quay.io/keycloak/keycloak:25.0.1 | ||
COPY --from=ubi-micro-build /root/jq /usr/bin/jq | ||
|
||
COPY keycloak_setup.sh /keycloak_setup.sh | ||
|
||
ENTRYPOINT [ "bash", "-c", "/keycloak_setup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { test, expect, type TestInfo } from '@playwright/test'; | ||
import { MailDev } from 'maildev'; | ||
|
||
import * as utils from "../global-utils"; | ||
import { logNewUser, logUser } from './setups/sso'; | ||
|
||
let users = utils.loadEnv(); | ||
|
||
let mailServer; | ||
|
||
test.beforeAll('Setup', async ({ browser }, testInfo: TestInfo) => { | ||
mailServer = new MailDev({ | ||
port: process.env.MAILDEV_SMTP_PORT, | ||
web: { port: process.env.MAILDEV_HTTP_PORT }, | ||
}) | ||
|
||
await mailServer.listen(); | ||
|
||
await utils.startVaultwarden(browser, testInfo, { | ||
SSO_ENABLED: true, | ||
SSO_ONLY: true, | ||
SSO_ORGANIZATIONS_INVITE: true, | ||
SSO_SCOPES: "email profile groups", | ||
SMTP_HOST: process.env.MAILDEV_HOST, | ||
SMTP_FROM: process.env.VAULTWARDEN_SMTP_FROM, | ||
}); | ||
}); | ||
|
||
test.afterAll('Teardown', async ({}) => { | ||
utils.stopVaultwarden(); | ||
mailServer?.close(); | ||
}); | ||
|
||
test('User auto invite', async ({ context, page }) => { | ||
let mail2Buffer = mailServer.buffer(users.user2.email); | ||
try { | ||
await logNewUser(test, page, users.user1); | ||
|
||
await test.step('Create Org', async () => { | ||
await page.getByRole('link', { name: 'New organisation' }).click(); | ||
await page.getByLabel('Organisation name (required)').fill('Test'); | ||
await page.getByRole('button', { name: 'Submit' }).click(); | ||
await page.locator('div').filter({ hasText: 'Members' }).nth(2).click(); | ||
}); | ||
|
||
await test.step('Log user2 and receive invite', async () => { | ||
await context.clearCookies(); | ||
await logNewUser(test, page, users.user2, { mailBuffer: mail2Buffer }); | ||
await expect(mail2Buffer.next((m) => m.subject === "Join Test")).resolves.toBeDefined(); | ||
}); | ||
} finally { | ||
mail2Buffer.close(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.