mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: better display secret audit values (#5801)
This commit is contained in:
@@ -41,7 +41,7 @@ export const AuditLogDiff: FC<{ diff: AuditLog["diff"] }> = ({ diff }) => {
|
||||
styles.diffValueOld,
|
||||
])}
|
||||
>
|
||||
{getDiffValue(valueDiff.old)}
|
||||
{valueDiff.secret ? "••••••••" : getDiffValue(valueDiff.old)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@ export const AuditLogDiff: FC<{ diff: AuditLog["diff"] }> = ({ diff }) => {
|
||||
styles.diffValueNew,
|
||||
])}
|
||||
>
|
||||
{getDiffValue(valueDiff.new)}
|
||||
{valueDiff.secret ? "••••••••" : getDiffValue(valueDiff.new)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
MockAuditLog2,
|
||||
MockAuditLogWithWorkspaceBuild,
|
||||
MockAuditLogWithDeletedResource,
|
||||
MockAuditLogGitSSH,
|
||||
} from "testHelpers/entities"
|
||||
import { AuditLogRow, AuditLogRowProps } from "./AuditLogRow"
|
||||
|
||||
@@ -72,3 +73,8 @@ export const DeletedResource = Template.bind({})
|
||||
DeletedResource.args = {
|
||||
auditLog: MockAuditLogWithDeletedResource,
|
||||
}
|
||||
|
||||
export const SecretDiffValue = Template.bind({})
|
||||
SecretDiffValue.args = {
|
||||
auditLog: MockAuditLogGitSSH,
|
||||
}
|
||||
|
||||
@@ -1066,6 +1066,22 @@ export const MockAuditLogWithDeletedResource: TypesGen.AuditLog = {
|
||||
is_deleted: true,
|
||||
}
|
||||
|
||||
export const MockAuditLogGitSSH: TypesGen.AuditLog = {
|
||||
...MockAuditLog,
|
||||
diff: {
|
||||
private_key: {
|
||||
old: "",
|
||||
new: "",
|
||||
secret: true,
|
||||
},
|
||||
public_key: {
|
||||
old: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINRUPjBSNtOAnL22+r07OSu9t3Lnm8/5OX8bRHECKS9g\n",
|
||||
new: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEwoUPJPMekuSzMZyV0rA82TGGNzw/Uj/dhLbwiczTpV\n",
|
||||
secret: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const MockWorkspaceQuota: TypesGen.WorkspaceQuota = {
|
||||
credits_consumed: 0,
|
||||
budget: 100,
|
||||
|
||||
Reference in New Issue
Block a user