Skip to content

Commit

Permalink
Merge branch 'master' into add-src-and-image-to-envs
Browse files Browse the repository at this point in the history
  • Loading branch information
satr authored Feb 29, 2024
2 parents a50210d + 0b1cd1c commit 6750adc
Show file tree
Hide file tree
Showing 20 changed files with 519 additions and 302 deletions.
3 changes: 2 additions & 1 deletion docker-compose-host-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ services:
- "8080:8080"

auth:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1
image: quay.io/oauth2-proxy/oauth2-proxy:v7.6.0
container_name: radix-auth_container
environment:
# See the `radixconfig.yaml` file for a description of these settings
Expand All @@ -67,6 +67,7 @@ services:
- OAUTH2_PROXY_EMAIL_DOMAINS=*
- OAUTH2_PROXY_HTTP_ADDRESS=http://:8000
- OAUTH2_PROXY_OIDC_ISSUER_URL=https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0/v2.0
- OAUTH2_PROXY_SKIP_CLAIMS_FROM_PROFILE_URL=true
- OAUTH2_PROXY_PASS_ACCESS_TOKEN=true
- OAUTH2_PROXY_PASS_BASIC_AUTH=false
- OAUTH2_PROXY_PASS_USER_HEADERS=false
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
- "8080:8080"

auth:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1
image: quay.io/oauth2-proxy/oauth2-proxy:v7.6.0
container_name: radix-auth_container
environment:
# See the `radixconfig.yaml` file for a description of these settings
Expand All @@ -49,6 +49,7 @@ services:
- OAUTH2_PROXY_EMAIL_DOMAINS=*
- OAUTH2_PROXY_HTTP_ADDRESS=http://:8000
- OAUTH2_PROXY_OIDC_ISSUER_URL=https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0/v2.0
- OAUTH2_PROXY_SKIP_CLAIMS_FROM_PROFILE_URL=true
- OAUTH2_PROXY_PASS_ACCESS_TOKEN=true
- OAUTH2_PROXY_PASS_BASIC_AUTH=false
- OAUTH2_PROXY_PASS_USER_HEADERS=false
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- "8080:8080"

auth:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1
image: quay.io/oauth2-proxy/oauth2-proxy:v7.6.0
container_name: radix-auth_container
environment:
# See the `radixconfig.yaml` file for a description of these settings
Expand All @@ -53,6 +53,7 @@ services:
- OAUTH2_PROXY_EMAIL_DOMAINS=*
- OAUTH2_PROXY_HTTP_ADDRESS=http://:8000
- OAUTH2_PROXY_OIDC_ISSUER_URL=https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0/v2.0
- OAUTH2_PROXY_SKIP_CLAIMS_FROM_PROFILE_URL=true
- OAUTH2_PROXY_PASS_ACCESS_TOKEN=true
- OAUTH2_PROXY_PASS_BASIC_AUTH=false
- OAUTH2_PROXY_PASS_USER_HEADERS=false
Expand Down
254 changes: 127 additions & 127 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"apigen:service-now": "npx @rtk-query/codegen-openapi ./src/store/configs/service-now-openapi-config.ts"
},
"dependencies": {
"@azure/msal-browser": "^3.6.0",
"@azure/msal-react": "^2.0.8",
"@azure/msal-browser": "^3.9.0",
"@azure/msal-react": "^2.0.9",
"@equinor/eds-core-react": "^0.35.1",
"@equinor/eds-icons": "^0.20.0",
"@microsoft/microsoft-graph-client": "^3.0.7",
"@reduxjs/toolkit": "^1.9.7",
"clsx": "^2.1.0",
"date-fns": "^3.0.6",
"date-fns": "^3.1.0",
"http-status-codes": "^2.3.0",
"jdenticon": "^3.2.0",
"lodash": "^4.17.21",
Expand All @@ -59,7 +59,7 @@
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"depcheck": "^1.4.7",
"eslint": "^8.56.0",
Expand All @@ -68,15 +68,15 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fetch-mock": "^9.11.0",
"jsdom": "^23.0.1",
"jsdom": "^23.1.0",
"license-checker": "^25.0.1",
"miragejs": "^0.1.48",
"mock-socket": "^9.3.1",
"prettier": "^3.1.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"vite-plugin-eslint": "^1.8.1",
"vitest": "^1.1.0"
"vitest": "^1.1.1"
},
"jest": {
"transformIgnorePatterns": [
Expand Down
3 changes: 2 additions & 1 deletion radixconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
- DYNATRACE_API_TOKEN # Token to use for display of availability metrics
- OAUTH2_CLIENT_ID # Azure Application ID
- name: auth
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1 # see https://github.com/oauth2-proxy/oauth2-proxy/blob/master/docs/docs/configuration/overview.md
image: quay.io/oauth2-proxy/oauth2-proxy:v7.6.0 # see https://github.com/oauth2-proxy/oauth2-proxy/blob/master/docs/docs/configuration/overview.md
ports:
- name: http
port: 8000
Expand All @@ -63,6 +63,7 @@ spec:
OAUTH2_PROXY_EMAIL_DOMAINS: "*" # Any email address registered in AD should be accepted
OAUTH2_PROXY_HTTP_ADDRESS: "http://:8000" # The port oauth2_proxy listens on
OAUTH2_PROXY_OIDC_ISSUER_URL: "https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0/v2.0" # That's the Equinor tenant ID
OAUTH2_PROXY_SKIP_CLAIMS_FROM_PROFILE_URL: "true"
OAUTH2_PROXY_PASS_ACCESS_TOKEN: "true" # Pass the access token upstream (to the proxy component)
OAUTH2_PROXY_PASS_BASIC_AUTH: "false" # Disable unused default
OAUTH2_PROXY_PASS_USER_HEADERS: "false" # Disable unused default
Expand Down
59 changes: 0 additions & 59 deletions src/components/app-overview/dns-aliases.tsx

This file was deleted.

29 changes: 24 additions & 5 deletions src/components/app-overview/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Typography } from '@equinor/eds-core-react';

import { DefaultAppAlias } from './default-app-alias';
import { DnsAliases } from './dns-aliases';
import { DefaultAppAlias } from '../component/default-app-alias';
import { DNSAliases } from '../component/dns-aliases';
import { Alert } from '../alert';
import ApplicationCost from '../application-cost';
import { FutureApplicationCost } from '../application-future-cost';
Expand All @@ -25,8 +25,14 @@ export function AppOverview({ appName }: { appName: string }) {
{ skip: !appName, pollingInterval }
);

const { appAlias, dnsAliases, environments, jobs, registration } =
application ?? {};
const {
appAlias,
dnsAliases,
dnsExternalAliases,
environments,
jobs,
registration,
} = application ?? {};

return (
<main className="grid grid--gap-medium">
Expand All @@ -47,7 +53,20 @@ export function AppOverview({ appName }: { appName: string }) {
</div>

{appAlias && <DefaultAppAlias appName={appName} appAlias={appAlias} />}
{dnsAliases && <DnsAliases appName={appName} dnsAliases={dnsAliases} />}
{dnsAliases && (
<DNSAliases
appName={appName}
dnsAliases={dnsAliases}
title={'DNS aliases'}
/>
)}
{DNSAliases && (
<DNSAliases
appName={appName}
dnsAliases={dnsExternalAliases}
title={'DNS external aliases'}
/>
)}
{environments?.length > 0 && (
<Typography variant="h4">Environments</Typography>
)}
Expand Down
71 changes: 71 additions & 0 deletions src/components/component/dns-aliases.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Accordion, List, Typography } from '@equinor/eds-core-react';
import { FunctionComponent } from 'react';
import { DnsAlias, DnsExternalAlias } from '../../store/radix-api';
import { DNSAlias } from './dns_alias';

export interface DefaultAppAliasProps {
appName: string;
dnsAliases?: DnsAlias[] | DnsExternalAlias[];
title: string;
}

export const DNSAliases: FunctionComponent<DefaultAppAliasProps> = ({
appName,
dnsAliases,
title,
}) => (
<>
{dnsAliases?.length > 0 &&
(dnsAliases.length == 1 ? (
<div className="grid grid--gap-x-small">
<Typography variant="h4">{title}</Typography>
<Typography as="span">
<DNSAlias
appName={appName}
url={dnsAliases[0].url}
componentName={dnsAliases[0].componentName}
environmentName={dnsAliases[0].environmentName}
/>
</Typography>
</div>
) : (
<>
<Typography className="whitespace-nowrap" variant="h4" as="span">
{title}
</Typography>
<Accordion className="accordion elevated" chevronPosition="right">
<Accordion.Item isExpanded={false}>
<Accordion.Header>
<Accordion.HeaderTitle>
<Typography className="whitespace-nowrap" as="span">
<DNSAlias
appName={appName}
url={dnsAliases[0].url}
componentName={dnsAliases[0].componentName}
environmentName={dnsAliases[0].environmentName}
/>
</Typography>
</Accordion.HeaderTitle>
</Accordion.Header>
<Accordion.Panel>
<List>
{dnsAliases.slice(1)?.map((dnsAlias, index) => (
<div key={index} className="o-item-list">
<Typography as="span">
<DNSAlias
appName={appName}
url={dnsAlias.url}
componentName={dnsAlias.componentName}
environmentName={dnsAlias.environmentName}
/>
</Typography>
</div>
))}
</List>
</Accordion.Panel>
</Accordion.Item>
</Accordion>
</>
))}
</>
);
38 changes: 38 additions & 0 deletions src/components/component/dns_alias.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Icon, Typography } from '@equinor/eds-core-react';
import { link } from '@equinor/eds-icons';
import { FunctionComponent } from 'react';
import { Link } from 'react-router-dom';

import { getActiveComponentUrl, getEnvUrl } from '../../utils/routing';
export interface EnvironmentComponentProps {
appName: string;
url: string;
componentName: string;
environmentName: string;
}

export const DNSAlias: FunctionComponent<EnvironmentComponentProps> = ({
appName,
url,
componentName,
environmentName,
}) => (
<>
<Icon data={link} />
<Typography link href={`https://${url}`}>
{url}
</Typography>{' '}
is mapped to component{' '}
<Typography
as={Link}
to={getActiveComponentUrl(appName, environmentName, componentName)}
link
>
{componentName}
</Typography>{' '}
in environment{' '}
<Typography as={Link} to={getEnvUrl(appName, environmentName)} link>
{environmentName}
</Typography>
</>
);
Loading

0 comments on commit 6750adc

Please sign in to comment.