Skip to content

Commit

Permalink
chore: rename frontend too
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Nov 21, 2024
1 parent 879f763 commit c387671
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions internal/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ const queryCreateCertificateRequestsTable = `
certificate_chain TEXT DEFAULT '',
status TEXT DEFAULT 'Outstanding',
CHECK (request_status IN ('Outstanding', 'Rejected', 'Revoked', 'Active')),
CHECK (NOT (certificate_chain == '' AND request_status == 'Active' )),
CHECK (NOT (certificate_chain != '' AND request_status == 'Outstanding'))
CHECK (NOT (certificate_chain != '' AND request_status == 'Rejected'))
CHECK (NOT (certificate_chain != '' AND request_status == 'Revoked'))
CHECK (status IN ('Outstanding', 'Rejected', 'Revoked', 'Active')),
CHECK (NOT (certificate_chain == '' AND status == 'Active' )),
CHECK (NOT (certificate_chain != '' AND status == 'Outstanding'))
CHECK (NOT (certificate_chain != '' AND status == 'Rejected'))
CHECK (NOT (certificate_chain != '' AND status == 'Revoked'))
)`

const queryCreateUsersTable = `
Expand All @@ -68,7 +68,7 @@ const (
listCertificateRequestsStmt = "SELECT &CertificateRequest.* FROM %s"
getCertificateRequestStmt = "SELECT &CertificateRequest.* FROM %s WHERE id==$CertificateRequest.id or csr==$CertificateRequest.csr"
createCertificateRequestStmt = "INSERT INTO %s (csr) VALUES ($CertificateRequest.csr)"
updateCertificateRequestStmt = "UPDATE %s SET certificate_chain=$CertificateRequest.certificate_chain, request_status=$CertificateRequest.request_status WHERE id==$CertificateRequest.id or csr==$CertificateRequest.csr"
updateCertificateRequestStmt = "UPDATE %s SET certificate_chain=$CertificateRequest.certificate_chain, status=$CertificateRequest.status WHERE id==$CertificateRequest.id or csr==$CertificateRequest.csr"
deleteCertificateRequestStmt = "DELETE FROM %s WHERE id=$CertificateRequest.id or csr=$CertificateRequest.csr"
)

Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/(notary)/certificate_requests/table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ uMNMgwl0fxGMQZjrlXyCBhXBm1k6PmwcJGJF5LQ31c+5aTTMFU7SyZhlymctB8mS
y+ErBQsRpcQho6Ok+HTXQQUcx7WNcwI=
-----END CERTIFICATE REQUEST-----`,
'certificate_chain': "",
'csr_status': "Outstanding",
'status': "Outstanding",
},
{
'id': 2,
Expand All @@ -49,7 +49,7 @@ WsDOAOH6qKQKQg3BO/xmRoohC6GL4CuhP7HYGi7+wziNhNZQa4GtE/k9DyIXVtJy
yuf2PnfXCKnaIWRJNoEqDCZRVMfA5BFSwTPITqyo
-----END CERTIFICATE REQUEST-----`,
'certificate_chain': "",
'csr_status': "Rejected"
'status': "Rejected"
},
{
'id': 3,
Expand Down Expand Up @@ -93,7 +93,7 @@ gCX3nqYpp70oZIFDrhmYwE5ij5KXlHD4/1IOfNUKCDmQDgGPLI1tVtwQLjeRq7Hg
XVelpl/LXTQawmJyvDaVT/Q9P+WqoDiMjrqF6Sy7DzNeeccWVqvqX5TVS6Ky56iS
Mvo/+PAJHkBciR5Xn+Wg2a+7vrZvT6CBoRSOTozlLSM=
-----END CERTIFICATE-----`,
'csr_status': 'Active'
'status': 'Active'
},
]

Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/(notary)/certificate_requests/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function CertificateRequestsTable({ csrs: rows }: TableProps) {
};

const csrrows = rows.map((csrEntry) => {
const { id, csr, certificate_chain, csr_status } = csrEntry;
const { id, csr, certificate_chain, status: csr_status } = csrEntry;
const csrObj = extractCSR(csr);
const certs = splitBundle(certificate_chain);
const clientCertificate = certs?.at(0);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type CSREntry = {
id: number,
csr: string,
certificate_chain: string
csr_status: "Outstanding" | "Active" | "Rejected" | "Revoked"
status: "Outstanding" | "Active" | "Rejected" | "Revoked"
}

export type User = {
Expand Down

0 comments on commit c387671

Please sign in to comment.