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 SSO role mapping to add admin cookie
Co-authored-by: Fabian Fischer <[email protected]>
- Loading branch information
Showing
14 changed files
with
303 additions
and
80 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
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 | ||
COPY --from=ubi-micro-build /root/jq /usr/bin/jq | ||
|
||
COPY keycloak_setup.sh /root/keycloak_setup.sh | ||
|
||
ENTRYPOINT ["/root/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
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,51 @@ | ||
import { test, expect, type TestInfo } from '@playwright/test'; | ||
|
||
import * as utils from "../global-utils"; | ||
import { logNewUser, logUser } from './setups/sso'; | ||
|
||
let users = utils.loadEnv(); | ||
|
||
let mailserver, user1Mails, user2Mails; | ||
|
||
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, | ||
SMTP_HOST: process.env.MAILDEV_HOST, | ||
SMTP_FROM: process.env.VAULTWARDEN_SMTP_FROM, | ||
}); | ||
|
||
user1Mails = mailserver.iterator(users.user1.email); | ||
user2Mails = mailserver.iterator(users.user2.email); | ||
}); | ||
|
||
test.afterAll('Teardown', async ({}) => { | ||
utils.stopVaultwarden(); | ||
utils.closeMails(mailserver, [user1Mails, user2Mails]); | ||
}); | ||
|
||
test('Log user1 and create Test Org', async ({ page }) => { | ||
await logNewUser(test, page, users.user1, { emails: user1Mails }); | ||
|
||
await test.step('Create Org', async () => { | ||
await page.getByRole('link', { name: 'New organization' }).click(); | ||
await page.getByLabel('Organization name (required)').fill('Test'); | ||
await page.getByRole('button', { name: 'Submit' }).click(); | ||
await page.locator('div').filter({ hasText: 'Members' }).nth(2).click(); | ||
}); | ||
}); | ||
|
||
test('Log with user2 and receive invite', async ({ page }) => { | ||
await logNewUser(test, page, users.user2, { emails: user2Mails }); | ||
|
||
const { value: invited } = await user2Mails.next(); | ||
expect(invited.subject).toContain("Join Test") | ||
}); |
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.