|
| 1 | +import path from "path"; |
| 2 | +import type { KeycloakClientConfig } from "./types.js"; |
| 3 | + |
| 4 | +// Navigate from dist/deployment/keycloak/ to package root |
| 5 | +const PACKAGE_ROOT = path.resolve(import.meta.dirname, "../../.."); |
| 6 | + |
| 7 | +export const DEFAULT_KEYCLOAK_CONFIG = { |
| 8 | + namespace: "rhdh-keycloak", |
| 9 | + releaseName: "keycloak", |
| 10 | + adminUser: "admin", |
| 11 | + adminPassword: "admin123", |
| 12 | + realm: "rhdh", |
| 13 | +}; |
| 14 | + |
| 15 | +export const DEFAULT_CONFIG_PATHS = { |
| 16 | + valuesFile: path.join( |
| 17 | + PACKAGE_ROOT, |
| 18 | + "dist/deployment/keycloak/config/keycloak-values.yaml", |
| 19 | + ), |
| 20 | +}; |
| 21 | + |
| 22 | +export const BITNAMI_CHART_REPO = "https://charts.bitnami.com/bitnami"; |
| 23 | +export const BITNAMI_CHART_NAME = "bitnami/keycloak"; |
| 24 | + |
| 25 | +export const DEFAULT_RHDH_CLIENT: KeycloakClientConfig = { |
| 26 | + clientId: "rhdh-client", |
| 27 | + clientSecret: "rhdh-client-secret", |
| 28 | + name: "RHDH Client", |
| 29 | + redirectUris: ["*"], |
| 30 | + webOrigins: ["*"], |
| 31 | + standardFlowEnabled: true, |
| 32 | + implicitFlowEnabled: true, |
| 33 | + directAccessGrantsEnabled: true, |
| 34 | + serviceAccountsEnabled: true, |
| 35 | + authorizationServicesEnabled: true, |
| 36 | + publicClient: false, |
| 37 | + defaultClientScopes: [ |
| 38 | + "service_account", |
| 39 | + "web-origins", |
| 40 | + "roles", |
| 41 | + "profile", |
| 42 | + "basic", |
| 43 | + "email", |
| 44 | + ], |
| 45 | + optionalClientScopes: [ |
| 46 | + "address", |
| 47 | + "phone", |
| 48 | + "offline_access", |
| 49 | + "microprofile-jwt", |
| 50 | + ], |
| 51 | +}; |
| 52 | + |
| 53 | +export const DEFAULT_GROUPS = [ |
| 54 | + { name: "developers" }, |
| 55 | + { name: "admins" }, |
| 56 | + { name: "viewers" }, |
| 57 | +]; |
| 58 | + |
| 59 | +export const DEFAULT_USERS = [ |
| 60 | + { |
| 61 | + username: "test1", |
| 62 | + email: "test1@example.com", |
| 63 | + firstName: "Test", |
| 64 | + lastName: "User1", |
| 65 | + enabled: true, |
| 66 | + emailVerified: true, |
| 67 | + password: "test1@123", |
| 68 | + groups: ["developers"], |
| 69 | + }, |
| 70 | + { |
| 71 | + username: "test2", |
| 72 | + email: "test2@example.com", |
| 73 | + firstName: "Test", |
| 74 | + lastName: "User2", |
| 75 | + enabled: true, |
| 76 | + emailVerified: true, |
| 77 | + password: "test2@123", |
| 78 | + groups: ["developers"], |
| 79 | + }, |
| 80 | +]; |
| 81 | + |
| 82 | +// Service account roles required for RHDH integration |
| 83 | +export const SERVICE_ACCOUNT_ROLES = [ |
| 84 | + "view-authorization", |
| 85 | + "manage-authorization", |
| 86 | + "view-users", |
| 87 | +]; |
0 commit comments