diff --git a/applications/accounts/Dockerfile b/applications/accounts/Dockerfile index 78b20c996..ea9d5529b 100644 --- a/applications/accounts/Dockerfile +++ b/applications/accounts/Dockerfile @@ -15,4 +15,4 @@ COPY themes/custom /opt/keycloak/themes/custom COPY plugins/* /opt/keycloak/providers/ ENTRYPOINT [ "/opt/keycloak/bin/kc-entrypoint.sh" ] -CMD [ "start-dev", "--import-realm", "--health-enabled=true", "--metrics-enabled=true" ] \ No newline at end of file +CMD [ "start-dev", "--import-realm", "--health-enabled=true", "--metrics-enabled=true", "--verbose" ] \ No newline at end of file diff --git a/applications/accounts/deploy/resources/realm.json b/applications/accounts/deploy/resources/realm.json index e7e764ad8..80888301c 100644 --- a/applications/accounts/deploy/resources/realm.json +++ b/applications/accounts/deploy/resources/realm.json @@ -146,7 +146,75 @@ {{- end }} } }, + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account", + "view-groups" + ] + } + ] + }, "clients": [ + { + "id": "18893fbb-8252-4aaa-bc9b-60799ceb9932", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": {{ printf "/realms/%s/account" .Values.namespace | quote }}, + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + {{ printf "/realms/%s/account/*" .Values.namespace | quote }} + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "realm_client": "false", + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "9a68ec2d-943d-49cb-9fdd-cd821d606210", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "service_account", + "web-origins", + "acr", + "address", + "administrator-scope", + "phone", + "profile", + "roles", + "microprofile-jwt", + "basic", + "email" + ], + "optionalClientScopes": [] + }, { "id": "9a6a2560-c6be-4493-8bd5-3fdc4522d82b", "clientId": {{ .Values.apps.accounts.client.id | quote }}, @@ -319,6 +387,17 @@ "claim.name": "groups", "jsonType.label": "String" } + }, + { + "id": "f99f57ac-a765-4aba-9b45-9425beec0a9f", + "name": "sub", + "protocol": "openid-connect", + "protocolMapper": "oidc-sub-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } } ] }, diff --git a/applications/backoffice/src/types/workspace.ts b/applications/backoffice/src/types/workspace.ts index 7223d0e8b..3c15051f0 100644 --- a/applications/backoffice/src/types/workspace.ts +++ b/applications/backoffice/src/types/workspace.ts @@ -32,7 +32,7 @@ export interface ResourceType { export const OSBApplications: { [id: string]: OSBApplication } = { nwbexplorer: { name: "NWB Explorer", subdomain: "nwbexplorer" }, netpyne: { name: "NetPyNE", subdomain: "netpyne" }, - jupyter: { name: "JupyterLab", subdomain: "notebooks" }, + jupyter: { name: "JupyterLab", subdomain: "lab" }, } export const SampleResourceTypes = { diff --git a/applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py b/applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py index 0778fdabf..a9ea8b2f6 100644 --- a/applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py +++ b/applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py @@ -38,7 +38,7 @@ class CookieNotFound(Exception): def change_pod_manifest(self: KubeSpawner): """ - Application Hook to change the manifest of the notebook image + Application Hook to change the manifest of the notebook pod before spawning it. Args: diff --git a/applications/netpyne/deploy/values.yaml b/applications/netpyne/deploy/values.yaml index 69f9a87d5..542737608 100644 --- a/applications/netpyne/deploy/values.yaml +++ b/applications/netpyne/deploy/values.yaml @@ -1,5 +1,7 @@ harness: subdomain: netpyne + secured: true + uri_role_mapping: [] service: auto: false port: 80 diff --git a/applications/osb-portal/.babelrc b/applications/osb-portal/.babelrc deleted file mode 100644 index 2b53150f6..000000000 --- a/applications/osb-portal/.babelrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ], - "env": { - "production":{ - "presets": ["minify"] - } - }, - "plugins": [ - "@babel/transform-regenerator", - "@babel/plugin-proposal-class-properties", - [ - "module-resolver", { - "root": ["./src"] - } - ] - ] -} \ No newline at end of file diff --git a/applications/osb-portal/.eslintignore b/applications/osb-portal/.eslintignore deleted file mode 100644 index 269445acd..000000000 --- a/applications/osb-portal/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -/src/apiclient/ -dist/ -node_modules/ -webpack*.js -public/ \ No newline at end of file diff --git a/applications/osb-portal/.eslintrc.yaml b/applications/osb-portal/.eslintrc.yaml deleted file mode 100644 index 011fa6d78..000000000 --- a/applications/osb-portal/.eslintrc.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -root: true -extends: - - eslint:recommended - - plugin:react/recommended -parser: "@babel/eslint-parser" -parserOptions: - ecmaFeatures: - jsx: true -plugins: - - react - - react-hooks -settings: - react: - version: detect -env: - browser: true - es6: true - node: true -rules: - no-console: 0 - func-style: 0 - consistent-return: 2 - prefer-arrow-callback: - - 2 - - allowNamedFunctions: false - allowUnboundThis: false - react/prop-types: 0 - react/forbid-prop-types: 0 - react/no-unused-prop-types: 0 - react-hooks/rules-of-hooks: 2 - react-hooks/exhaustive-deps: 1 - curly: 2 - no-tabs: 2 - arrow-spacing: 2 - no-unneeded-ternary: 2 - object-curly-spacing: - - 2 - - always - indent: - - 2 - - 2 - - SwitchCase: 1 -globals: - __dirname: writable - module: writable diff --git a/applications/osb-portal/deploy/values-local.yaml b/applications/osb-portal/deploy/values-local.yaml index b4bd6f66a..caf5cec6a 100644 --- a/applications/osb-portal/deploy/values-local.yaml +++ b/applications/osb-portal/deploy/values-local.yaml @@ -1,13 +1,13 @@ harness: sentry: false - dependencies: - soft: - - accounts - - accounts-api - - common - - volumemanager - - workspaces - - workflows - - jupyterhub - - jupyterlab - - backoffice \ No newline at end of file + # dependencies: + # soft: + # - accounts + # - accounts-api + # - common + # - volumemanager + # - workspaces + # - workflows + # - jupyterhub + # - jupyterlab + # - backoffice \ No newline at end of file diff --git a/applications/osb-portal/deploy/values.yaml b/applications/osb-portal/deploy/values.yaml index ffd00262a..f2e9b513c 100644 --- a/applications/osb-portal/deploy/values.yaml +++ b/applications/osb-portal/deploy/values.yaml @@ -1,6 +1,6 @@ harness: subdomain: www - secured: false + secured: true deployment: auto: true port: 80 @@ -39,3 +39,11 @@ harness: smoketest: true ignoreRequestErrors: false ignoreConsoleErrors: false + uri_role_mapping: + - roles: [] + uri: /* + white-listed: true + - uri: /login + roles: [] + - uri: /workspaces/open/* + roles: [] \ No newline at end of file diff --git a/applications/osb-portal/eslint.config.js b/applications/osb-portal/eslint.config.js new file mode 100644 index 000000000..7b906a81d --- /dev/null +++ b/applications/osb-portal/eslint.config.js @@ -0,0 +1,62 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' + + +export default tseslint.config( + { + ignores: [ + 'dist', + 'node_modules', + '.yalc', + 'src/rest', + 'eslint.config.js' + ] + }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx,js,jsx}'], + languageOptions: { + ecmaVersion: "latest", + globals: globals.browser, + sourceType: "module" + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + // indent: ["warn", 2], + // indent: ["warn", 2, { + // SwitchCase: 1, + // ignoredNodes: ["JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"] + // }], + curly: "error", // enforce braces for one-line blocks + "no-tabs": "error", // enforce no tabs + "no-console": ["warn", { + allow: ["warn", "error", "debug"], + }], + "@typescript-eslint/no-unused-vars": "warn", // + "@typescript-eslint/no-explicit-any": "off", // No strict typing (annoying especially with React elements and events callbacks) + "@typescript-eslint/no-empty-object-type": "warn", + "consistent-return": "warn", // https://eslint.org/docs/latest/rules/consistent-return + "prefer-arrow-callback": ["warn"], + "object-curly-spacing": ["warn", "always"], // enforce consistent spacing inside braces + "func-style": "off", // function expressions or arrow functions are equally valid + "no-unneeded-ternary": "warn", // disallow unnecessary ternary expressions + // React rules: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules + "react/prop-types": "off", // PropTypes are not forced + "react/forbid-prop-types": "off", // all PropTypes are allowed + "react-hooks/rules-of-hooks": "error", // https://react.dev/reference/rules/rules-of-hooks + "react-hooks/exhaustive-deps": "warn", // Hooks dependency array, sometimes it's better to ignore + "no-constant-binary-expression": "warn" + }, + } +) \ No newline at end of file diff --git a/applications/osb-portal/index.html b/applications/osb-portal/index.html new file mode 100644 index 000000000..820f69a9b --- /dev/null +++ b/applications/osb-portal/index.html @@ -0,0 +1,32 @@ + + + +
+ + +