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

Release 2.13.1 #807

Merged
merged 3 commits into from
Nov 8, 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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "czertainly-administrator",
"version": "2.13.0",
"version": "2.13.1",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Badge } from 'reactstrap';
import {
CertificateEventHistoryDtoStatusEnum,
CertificateState,
CertificateSubjectType,
CertificateValidationStatus,
ComplianceRuleStatus,
ComplianceStatus,
Expand All @@ -10,7 +11,13 @@ import { getCertificateStatusColor, useGetStatusText } from 'utils/certificate';
import { capitalize } from 'utils/common-utils';

interface Props {
status: CertificateState | CertificateValidationStatus | CertificateEventHistoryDtoStatusEnum | ComplianceStatus | ComplianceRuleStatus;
status:
| CertificateState
| CertificateValidationStatus
| CertificateEventHistoryDtoStatusEnum
| ComplianceStatus
| ComplianceRuleStatus
| CertificateSubjectType;
asIcon?: boolean;
}

Expand Down
11 changes: 6 additions & 5 deletions src/components/_pages/certificates/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
CertificateFormatEncoding,
CertificateRequestFormat,
CertificateRevocationReason,
CertificateSubjectType,
CertificateValidationStatus,
} from '../../../../types/openapi';

Expand Down Expand Up @@ -1422,8 +1423,8 @@ export default function CertificateDetail() {
],
},
{
id: 'basicConstraint',
columns: ['Basic Constraint', certificate.basicConstraints],
id: 'subjectType',
columns: ['Subject Type', <CertificateStatus status={certificate.subjectType} />],
},
];
if (certificate?.state !== CertStatus.Requested) {
Expand All @@ -1437,7 +1438,7 @@ export default function CertificateDetail() {
certDetail.unshift({
id: 'trustedCa',
columns: [
certificate?.basicConstraints?.includes('End Entity') ? 'Trusted Self-Signed' : 'Trusted CA',
certificate?.subjectType == CertificateSubjectType.SelfSignedEndEntity ? 'Trusted Self-Signed' : 'Trusted CA',
<SwitchWidget disabled={isUpdatingTrustedStatus} checked={certificate.trustedCa ?? false} onClick={switchCallback} />,
],
});
Expand Down Expand Up @@ -1468,7 +1469,7 @@ export default function CertificateDetail() {
width: 'auto',
},
{
content: 'Multiple Entires',
content: 'Multiple Entries',
align: 'center',
sortable: true,
id: 'multiEntries',
Expand Down Expand Up @@ -1547,7 +1548,7 @@ export default function CertificateDetail() {
width: 'auto',
},
{
content: 'Multiple Entires',
content: 'Multiple Entries',
align: 'center',
sortable: true,
id: 'multiEntries',
Expand Down
22 changes: 19 additions & 3 deletions src/components/_pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,26 @@ function Dashboard() {

<Col>
<DonutChart
title={'Certificates by Constraints'}
data={dashboard?.certificateStatByBasicConstraints}
title={'Certificates by Subject type'}
data={dashboard?.certificateStatBySubjectType}
entity={EntityType.CERTIFICATE}
onSetFilter={(_index, _labels) => []}
onSetFilter={(index, labels) => {
const certificateSubjectTypeEnum = platformEnums?.CertificateSubjectType;
const certificateSubjectTypeList = Object.keys(certificateSubjectTypeEnum).map(
(key) => certificateSubjectTypeEnum[key],
);
const selectedCertificateSubjectType = certificateSubjectTypeList.find(
(status) => status.label === labels[index],
);
return [
{
fieldSource: FilterFieldSource.Property,
condition: FilterConditionOperator.Equals,
fieldIdentifier: 'SUBJECT_TYPE',
value: selectedCertificateSubjectType?.code ? [selectedCertificateSubjectType?.code] : [''],
},
];
}}
redirect="../certificates"
/>
</Col>
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ models/CertificateRequestFormat.ts
models/CertificateResponseDto.ts
models/CertificateRevocationReason.ts
models/CertificateState.ts
models/CertificateSubjectType.ts
models/CertificateType.ts
models/CertificateUpdateObjectsDto.ts
models/CertificateValidationCheck.ts
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/apis/LocationManagementApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class LocationManagementApi extends BaseAPI {
getSearchableFieldInformation(opts?: OperationOpts): Observable<AjaxResponse<Array<SearchFieldDataByGroupDto>>>
getSearchableFieldInformation(opts?: OperationOpts): Observable<Array<SearchFieldDataByGroupDto> | AjaxResponse<Array<SearchFieldDataByGroupDto>>> {
return this.request<Array<SearchFieldDataByGroupDto>>({
url: '/v1/search',
url: '/v1/locations/search',
method: 'GET',
}, opts?.responseOpts);
};
Expand Down
8 changes: 4 additions & 4 deletions src/types/openapi/models/CertificateDetailDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CZERTAINLY Core API
* REST API for CZERTAINLY Core
*
* The version of the OpenAPI document: 2.12.1-SNAPSHOT
* The version of the OpenAPI document: 2.13.1-SNAPSHOT
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -17,6 +17,7 @@ import type {
CertificateProtocolDto,
CertificateRequestDto,
CertificateState,
CertificateSubjectType,
CertificateType,
CertificateValidationStatus,
ComplianceStatus,
Expand Down Expand Up @@ -185,11 +186,10 @@ export interface CertificateDetailDto {
*/
keyUsage: Array<string>;
/**
* Basic Constraints
* @type {string}
* @type {CertificateSubjectType}
* @memberof CertificateDetailDto
*/
basicConstraints: string;
subjectType: CertificateSubjectType;
/**
* Certificate metadata
* @type {Array<MetadataResponseDto>}
Expand Down
25 changes: 25 additions & 0 deletions src/types/openapi/models/CertificateSubjectType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// tslint:disable
/**
* CZERTAINLY Core API
* REST API for CZERTAINLY Core
*
* The version of the OpenAPI document: 2.13.1-SNAPSHOT
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

/**
* Certificate subject type
* @export
* @enum {string}
*/
export enum CertificateSubjectType {
EndEntity = 'endEntity',
SelfSignedEndEntity = 'selfSignedEndEntity',
IntermediateCa = 'intermediateCa',
RootCa = 'rootCa'
}

3 changes: 2 additions & 1 deletion src/types/openapi/models/PlatformEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CZERTAINLY Core API
* REST API for CZERTAINLY Core
*
* The version of the OpenAPI document: 2.12.1-SNAPSHOT
* The version of the OpenAPI document: 2.13.1-SNAPSHOT
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -37,6 +37,7 @@ export enum PlatformEnum {
CertificateRequestFormat = 'CertificateRequestFormat',
DiscoveryStatus = 'DiscoveryStatus',
CertificateProtocol = 'CertificateProtocol',
CertificateSubjectType = 'CertificateSubjectType',
KeyAlgorithm = 'KeyAlgorithm',
KeyFormat = 'KeyFormat',
KeyState = 'KeyState',
Expand Down
6 changes: 3 additions & 3 deletions src/types/openapi/models/StatisticsDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* CZERTAINLY Core API
* REST API for CZERTAINLY Core
*
* The version of the OpenAPI document: 2.12.1-SNAPSHOT
* The version of the OpenAPI document: 2.13.1-SNAPSHOT
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -101,11 +101,11 @@ export interface StatisticsDto {
*/
certificateStatByKeySize?: { [key: string]: number; };
/**
* Map of Certificate count by basic constraints
* Map of Certificate count by subject type
* @type {{ [key: string]: number; }}
* @memberof StatisticsDto
*/
certificateStatByBasicConstraints?: { [key: string]: number; };
certificateStatBySubjectType?: { [key: string]: number; };
/**
* Map of Certificate count by state
* @type {{ [key: string]: number; }}
Expand Down
1 change: 1 addition & 0 deletions src/types/openapi/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export * from './CertificateRequestFormat';
export * from './CertificateResponseDto';
export * from './CertificateRevocationReason';
export * from './CertificateState';
export * from './CertificateSubjectType';
export * from './CertificateType';
export * from './CertificateUpdateObjectsDto';
export * from './CertificateValidationCheck';
Expand Down
38 changes: 34 additions & 4 deletions src/utils/certificate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CertificateDetailResponseModel } from 'types/certificate';
import {
CertificateEventHistoryDtoStatusEnum,
CertificateState,
CertificateSubjectType,
CertificateType,
CertificateValidationStatus,
ComplianceRuleStatus,
Expand All @@ -27,7 +28,7 @@ export const emptyCertificate: CertificateDetailResponseModel = {
keySize: -1,
keyUsage: [],
extendedKeyUsage: [],
basicConstraints: '',
subjectType: CertificateSubjectType.EndEntity,
state: CertificateState.PendingIssue,
validationStatus: CertificateValidationStatus.NotChecked,
fingerprint: '',
Expand Down Expand Up @@ -70,7 +71,13 @@ export function downloadFile(content: any, fileName: string) {
}

export function getCertificateStatusColor(
status: CertificateState | CertificateValidationStatus | CertificateEventHistoryDtoStatusEnum | ComplianceStatus | ComplianceRuleStatus,
status:
| CertificateState
| CertificateValidationStatus
| CertificateEventHistoryDtoStatusEnum
| ComplianceStatus
| ComplianceRuleStatus
| CertificateSubjectType,
) {
switch (status) {
case CertificateState.Requested:
Expand Down Expand Up @@ -130,6 +137,15 @@ export function getCertificateStatusColor(
case CertificateEventHistoryDtoStatusEnum.Success:
return '#1ab394';

case CertificateSubjectType.EndEntity:
return '#6c757d';
case CertificateSubjectType.SelfSignedEndEntity:
return '#f37d63';
case CertificateSubjectType.IntermediateCa:
return '#3754a5';
case CertificateSubjectType.RootCa:
return '#1ab394';

default:
return '#6c757d';
}
Expand All @@ -140,6 +156,7 @@ export function useGetStatusText() {
const certificateValidationStatusEnum = useSelector(enumSelectors.platformEnum(PlatformEnum.CertificateValidationStatus));
const complianceStatusEnum = useSelector(enumSelectors.platformEnum(PlatformEnum.ComplianceStatus));
const complianceRuleStatusEnum = useSelector(enumSelectors.platformEnum(PlatformEnum.ComplianceRuleStatus));
const certificateSubjectTypeEnum = useSelector(enumSelectors.platformEnum(PlatformEnum.CertificateSubjectType));

return useCallback(
(
Expand All @@ -148,7 +165,8 @@ export function useGetStatusText() {
| CertificateValidationStatus
| CertificateEventHistoryDtoStatusEnum
| ComplianceStatus
| ComplianceRuleStatus,
| ComplianceRuleStatus
| CertificateSubjectType,
) => {
switch (status) {
case CertificateValidationStatus.Valid:
Expand Down Expand Up @@ -187,11 +205,23 @@ export function useGetStatusText() {
case ComplianceRuleStatus.Na:
return getEnumLabel(complianceRuleStatusEnum, status);

case CertificateSubjectType.EndEntity:
case CertificateSubjectType.SelfSignedEndEntity:
case CertificateSubjectType.IntermediateCa:
case CertificateSubjectType.RootCa:
return getEnumLabel(certificateSubjectTypeEnum, status);

default:
return 'Unknown';
}
},
[certificateStatusEnum, certificateValidationStatusEnum, complianceStatusEnum, complianceRuleStatusEnum],
[
certificateStatusEnum,
certificateValidationStatusEnum,
complianceStatusEnum,
complianceRuleStatusEnum,
certificateSubjectTypeEnum,
],
);
}

Expand Down
Loading