Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

fix(ui): logout #849

Merged
merged 10 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions packages/ui/chart/templates/ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ spec:
value: '###ZARF_VAR_DISABLE_KEYCLOAK###'
- name: PUBLIC_MESSAGE_LENGTH_LIMIT
value: '###ZARF_VAR_MESSAGE_LENGTH_LIMIT###'
- name: SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL
value: "https://sso.{{ .Values.package.domain }}/realms/uds"
- name: SUPABASE_AUTH_KEYCLOAK_CLIENT_ID
valueFrom:
secretKeyRef:
name: sso-client-uds-supabase
key: clientId
- name: SUPABASE_AUTH_KEYCLOAK_SECRET
valueFrom:
secretKeyRef:
name: sso-client-uds-supabase
key: secret
resources:
requests:
memory: '0'
Expand Down
10 changes: 5 additions & 5 deletions src/leapfrogai_ui/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ PUBLIC_SUPABASE_ANON_KEY=<anon_key>
PUBLIC_DISABLE_KEYCLOAK=false
PUBLIC_MESSAGE_LENGTH_LIMIT=10000


# PRIVATE DYNAMIC
DEFAULT_TEMPERATURE=0.1
DEFAULT_SYSTEM_PROMPT="You are a helpful AI assistant created by Defense Unicorns."
DEFAULT_MODEL=vllm #for OpenAI it could be: gpt-3.5-turbo
LEAPFROGAI_API_BASE_URL=https://leapfrogai-api.uds.dev #for OpenAI it would be: https://api.openai.com
#If specified, app will use OpenAI instead of Leapfrog
OPENAI_API_KEY=

# SUPABASE AUTH (when running Supabase Locally)
SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL=https://sso.uds.dev/realms/uds
SUPABASE_AUTH_KEYCLOAK_CLIENT_ID=uds-supabase
SUPABASE_AUTH_KEYCLOAK_SECRET=<secret>
SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL=https://sso.uds.dev/realms/uds

#If specified, app will use OpenAI instead of Leapfrog
OPENAI_API_KEY=

# PLAYWRIGHT
USERNAME=user1@test.com
Expand Down
4 changes: 2 additions & 2 deletions src/leapfrogai_ui/tests/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ test('it can log out', async ({ page }) => {
if (process.env.PUBLIC_DISABLE_KEYCLOAK === 'true') {
await expect(page.getByText('Sign In')).toBeVisible();
} else {
const loginBtn = page.getByText('Log In');
const loginBtn = page.getByRole('button', { name: /Log In with UDS SSO/i });
await expect(loginBtn).toBeVisible();
await loginBtn.click();
await page.waitForURL(`${process.env.SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL!}/**/*`);
await page.waitForURL(`**/*/realms/uds/**/*`); // ensure full logout of keycloak (not just supabase)
}
});