Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(console): add impersonation tag to audit log #6267

Merged
merged 1 commit into from
Jul 19, 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
display: flex;
align-items: center;
white-space: nowrap;
gap: _.unit(2);

.icon {
flex-shrink: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
import Failed from '@/assets/icons/failed.svg';
import Success from '@/assets/icons/success.svg';
import { logEventTitle } from '@/consts/logs';
import Tag from '@/ds-components/Tag';
import useTenantPathname from '@/hooks/use-tenant-pathname';

import * as styles from './index.module.scss';
Expand Down Expand Up @@ -35,6 +36,7 @@ function EventName({ eventKey, isSuccess, to }: Props) {
</Link>
)}
{!to && <div className={styles.title}>{title}</div>}
{eventKey === 'ExchangeTokenBy.TokenExchange' && <Tag status="alert">Impersonation</Tag>}
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/console/src/consts/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const auditLogEventTitle: Record<string, Optional<string>> & {
'ExchangeTokenBy.AuthorizationCode': 'Exchange token by Code',
'ExchangeTokenBy.ClientCredentials': 'Exchange token by Client Credentials',
'ExchangeTokenBy.RefreshToken': 'Exchange token by Refresh Token',
'ExchangeTokenBy.TokenExchange': 'Token exchange',
'Interaction.Create': 'Interaction started',
'Interaction.End': 'Interaction ended',
'Interaction.ForgotPassword.Identifier.VerificationCode.Create':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
.eventName {
color: var(--color-text);
font: var(--font-title-1);
display: flex;
align-items: center;
gap: _.unit(2);
}

.basicInfo {
Expand Down
8 changes: 7 additions & 1 deletion packages/console/src/pages/AuditLogDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import CodeEditor from '@/ds-components/CodeEditor';
import DangerousRaw from '@/ds-components/DangerousRaw';
import FormField from '@/ds-components/FormField';
import TabNav, { TabNavItem } from '@/ds-components/TabNav';
import Tag from '@/ds-components/Tag';
import type { RequestError } from '@/hooks/use-api';
import { isWebhookEventLogKey } from '@/pages/WebhookDetails/utils';
import { getUserTitle } from '@/utils/user';
Expand Down Expand Up @@ -84,7 +85,12 @@ function AuditLogDetails() {
<Card className={styles.header}>
<EventIcon isSuccess={data.payload.result === 'Success'} />
<div className={styles.content}>
<div className={styles.eventName}>{logEventTitle[data.key]}</div>
<div className={styles.eventName}>
{logEventTitle[data.key]}
{data.key === 'ExchangeTokenBy.TokenExchange' && (
<Tag status="alert">Impersonation</Tag>
charIeszhao marked this conversation as resolved.
Show resolved Hide resolved
)}
</div>
<div className={styles.basicInfo}>
<div className={styles.infoItem}>
<div className={styles.label}>{t('log_details.event_key')}</div>
Expand Down
Loading