ocket8888 commented on code in PR #7555:
URL: https://github.com/apache/trafficcontrol/pull/7555#discussion_r1260169588
##########
experimental/traffic-portal/src/app/api/testing/delivery-service.service.ts:
##########
@@ -536,4 +544,20 @@ export class DeliveryServiceService {
public async getDSTypes(): Promise<Array<TypeFromResponse>> {
return this.dsTypes;
}
+
+ /**
+ * Gets a Delivery Service's SSL Keys
+ *
+ * @param ds The delivery service xmlid or object
+ * @returns The DS ssl keys
+ */
+ public async getSSLKeys(ds: string | ResponseDeliveryService):
Promise<ResponseDeliveryServiceSSLKey> {
+ const xmlId = typeof ds === "string" ? ds : ds.xmlId;
+ const key = this.dsSSLKeys.find(k => k.deliveryservice ===
xmlId);
+ if(!key) {
+ throw new Error(`no such Delivery Service: ${ds}`);
Review Comment:
the string-ification of an arbitrary object is just `[object Object]` which
doesn't tell you anything about which DS doesn't exist - this should use the
XMLID instead
##########
experimental/traffic-portal/package.json:
##########
@@ -61,12 +61,14 @@
"@angular/platform-server": "^16.0.4",
"@angular/router": "^16.0.4",
"@nguniversal/express-engine": "^16.0.2",
+ "@types/node-forge": "^1.3.2",
Review Comment:
this should be a dev dependency
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.scss:
##########
@@ -0,0 +1,34 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+div.mat-elevation-z2 {
Review Comment:
`mat-elevation-z2` sounds like an Angular Material class - if that's the
case, I'd suggest adding a new class rather than extending it here, because in
any other context the exact same class would apply a different styling. If
that's not the case, I suggest changing the name so that people reading it
don't think there's some other styling not defined here being applied.
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.spec.ts:
##########
@@ -0,0 +1,167 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+import { ComponentFixture, TestBed } from "@angular/core/testing";
+import * as forge from "node-forge";
+
+import { pkiCertToSHA1, pkiCertToSHA256 } from "src/app/core/certs/cert.util";
+
+import { Author, CertDetailComponent } from "./cert-detail.component";
+
+const certPEM = `
+-----BEGIN CERTIFICATE-----
+MIIDeTCCAmECFDWSnKTtkcoRnoTz6ChHqTuvCUPHMA0GCSqGSIb3DQEBCwUAMHkx
+CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDTzEPMA0GA1UEBwwGRGVudmVyMQ8wDQYD
+VQQKDAZBcGFjaGUxGDAWBgNVBAsMD1RyYWZmaWMgQ29udHJvbDEhMB8GA1UEAwwY
+dHJhZmZpY29wcy5kZXYuY2lhYi50ZXN0MB4XDTIzMDYwNTE0MDY0OFoXDTI0MDYw
+NDE0MDY0OFoweTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNPMQ8wDQYDVQQHDAZE
+ZW52ZXIxDzANBgNVBAoMBkFwYWNoZTEYMBYGA1UECwwPVHJhZmZpYyBDb250cm9s
+MSEwHwYDVQQDDBh0cmFmZmljb3BzLmRldi5jaWFiLnRlc3QwggEiMA0GCSqGSIb3
+DQEBAQUAA4IBDwAwggEKAoIBAQDKAcQK9fe9w7p7eMnygnlV0rlbUdVr9DEQpKym
+Ul7zGj9/Ta3n0h8xWrmmMi2ZJnIUI4AV7HKaYXiAke1rbEx2jAdvXdjNm/S7RORy
+M0piJc8Si4/EJI1sZU17kZ7howXJvAMCQBqcI+hG93ATlUIOoYuluX7wSNIMw1Np
+lT5bcmVDf5nVQGnrPw22mCGjH5JBxW5i1DjCoNovHfFgNmwP6y8C1jygoMPL+rxl
+sq8fyUE/+qtcEkjUrr4oi9kjTESDqHghrkejKk6NPlPi97SDz2Ffdagoq2aqBhw9
+P86JgplPVHHMWOLXBww0wPAClqY8H7CIt5rgZzoWmoR0DjjNAgMBAAEwDQYJKoZI
+hvcNAQELBQADggEBAMFz7k+egg+hP86ylEAuUfcy/beO3Pf3Fn7oMh5MDENfOzON
+IFqZOQ8pN1zfoAx0rRTzYHcg/AZs2AA4oh+WyEKHDrmICGfsF481b6A0EarZ/cRy
+MF3Vh5rTd8ujWT4V9GP3Hc/I3F5tUKxPWiVEKTVRr6wzjwtXctOnhcbB3FeRtGDY
+CfVBYMSEDJmAyMchfST/GwdG46Ak2TSaMpOf6tL5aMw+xfmDI68JGwG0LNliyEoW
+xOHRCtWd5Q+Sn3rgx4h6nzdZOGHw3HwDbsX/y/dZNc7luUImEWwTyhohnO9XqaBX
+EsdMDJmBaoVum+sR6ch08TsqrTHAfdB3xJF37Wc=
+-----END CERTIFICATE-----`;
+
+describe("CertDetailComponent", () => {
+ let component: CertDetailComponent;
+ let cert: forge.pki.Certificate;
+ let fixture: ComponentFixture<CertDetailComponent>;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [CertDetailComponent]
+ })
+ .compileComponents();
+
+ cert = forge.pki.certificateFromPem(certPEM);
+ cert.setIssuer([
+ {
+ name: "countryName",
+ shortName: "C",
+ type: "2.5.4.6",
+ value: "C",
+ valueTagClass: 19,
+ },
+ {
+ name: "stateOrProvinceName",
+ shortName: "ST",
+ type: "2.5.4.8",
+ value: "ST",
+ valueTagClass: 19,
+ },
+ {
+ name: "localityName",
+ shortName: "L",
+ type: "2.5.4.7",
+ value: "L",
+ valueTagClass: 19,
+ },
+ {
+ name: "organizationName",
+ shortName: "O",
+ type: "2.5.4.10",
+ value: "O",
+ valueTagClass: 19,
+ },
+ {
+ name: "commonName",
+ shortName: "CN",
+ type: "2.5.4.3",
+ value: "CN",
+ valueTagClass: 19,
+ },
+ {
+ name: "madeUp",
+ shortName: "idksomething",
+ type: "127.0.0.1",
+ value: "doesntmatter",
+ }
+ ]);
+ cert.setSubject([
+ {
+ name: "countryName",
+ shortName: "C",
+ type: "2.5.4.6",
+ value: "C",
+ valueTagClass: 19,
+ },
+ {
+ name: "stateOrProvinceName",
+ shortName: "ST",
+ type: "2.5.4.8",
+ value: "ST",
+ valueTagClass: 19,
+ },
+ {
+ name: "localityName",
+ shortName: "L",
+ type: "2.5.4.7",
+ value: "L",
+ valueTagClass: 19,
+ },
+ {
+ name: "organizationName",
+ shortName: "O",
+ type: "2.5.4.10",
+ value: "O",
+ valueTagClass: 19,
+ },
+ {
+ name: "commonName",
+ shortName: "CN",
+ type: "2.5.4.3",
+ value: "CN",
+ valueTagClass: 19,
+ }
+
+ ]);
+
+ fixture = TestBed.createComponent(CertDetailComponent);
+ component = fixture.componentInstance;
+ component.cert = cert;
+ fixture.detectChanges();
+ });
+
+ it("should create", () => {
+ expect(component).toBeTruthy();
+ });
+
+ it("Fields calculated correctly", async () => {
+ component.ngOnChanges();
+ expect(component.issuer).toEqual({
+ commonName: "CN",
+ countryName: "C",
+ localityName: "L",
+ orgName: "O",
+ stateOrProvince: "ST",
+ } as Author);
+ expect(component.subject).toEqual({
+ commonName: "CN",
+ countryName: "C",
+ localityName: "L",
+ orgName: "O",
+ stateOrProvince: "ST",
+ } as Author);
Review Comment:
I don't think `as Author` is necessary on these
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.ts:
##########
@@ -0,0 +1,134 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+import { Component, Input, OnChanges } from "@angular/core";
+import { AbstractControl, FormControl, ValidationErrors, ValidatorFn } from
"@angular/forms";
+import * as forge from "node-forge";
+import { Hex } from "node-forge";
+
+import { oidToName, pkiCertToSHA1, pkiCertToSHA256 } from
"src/app/core/certs/cert.util";
+
+/**
+ * Author contains the information about an author from a cert issuer/subject
+ */
+export interface Author {
+ countryName?: string | undefined;
+ stateOrProvince?: string | undefined;
+ localityName?: string | undefined;
+ orgName?: string | undefined;
+ orgUnit?: string | undefined;
+ commonName: string;
+}
+
+/**
+ * Angular validator that checks if the value is either before or after the
given time
+ *
+ * @param before If this is only valid before
+ * @param now The time to compare against
+ * @returns Validator Function
+ */
+function createDateValidator(before: boolean, now: Date): ValidatorFn {
+ return (control: AbstractControl): ValidationErrors | null => {
+ const value = control.value;
+ if (!value) {
+ return null;
+ }
+
+ let valid = false;
+ const d = new Date(value);
+ if (before) {
+ valid = now >= d;
+ } else {
+ valid = now <= d;
+ }
+
+ return valid ? null : {notValid: true};
+ };
+}
+
+/**
+ * Controller for the Cert Detail component
+ */
+@Component({
+ selector: "tp-cert-detail",
+ styleUrls: ["./cert-detail.component.scss"],
+ templateUrl: "./cert-detail.component.html"
+})
+export class CertDetailComponent implements OnChanges {
+ @Input() public cert!: forge.pki.Certificate;
Review Comment:
Mandatory inputs should appear in the selector for compile-time safety.
##########
experimental/traffic-portal/src/app/core/certs/cert-viewer/cert-viewer.component.scss:
##########
@@ -0,0 +1,33 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+.tab-content {
+ margin-top: 5px;
+ display: grid;
+
+ &:is(form), .mat-accordion {
+ width: 98%;
+ margin: auto auto 15px;
+ }
+}
+
+.private-text {
+ color: transparent !important;
Review Comment:
> `!important`
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.html:
##########
@@ -0,0 +1,68 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<div>
+ <div class="mat-elevation-z2">
+ <h2>Issuer</h2>
+ <tp-cert-author [author]="issuer"></tp-cert-author>
+ </div>
+ <div class="mat-elevation-z2">
+ <h2>Subject</h2>
+ <tp-cert-author [author]="subject"></tp-cert-author>
+ </div>
+ <div class="mat-elevation-z2">
+ <h2>Validity</h2>
+ <div class="content">
+ <div class="double">
+ <mat-form-field>
+ <mat-label>Not Valid Before</mat-label>
+ <input matInput type="date"
[formControl]="validBeforeFormControl" name="validBefore" readonly />
Review Comment:
just checking: is this always representative of a day, and never include a
time?
##########
experimental/traffic-portal/src/app/core/certs/cert.util.ts:
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import * as forge from "node-forge";
Review Comment:
why not `import { pki } from 'node-forge";`?
##########
experimental/traffic-portal/src/app/core/certs/cert-author/cert-author.component.ts:
##########
@@ -0,0 +1,30 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import { Component, Input } from "@angular/core";
+
+import { Author } from "src/app/core/certs/cert-detail/cert-detail.component";
+
+/**
+ * CertAuthorComponent is the controller used for displaying a cert author.
+ */
+@Component({
+ selector: "tp-cert-author",
+ styleUrls: ["./cert-author.component.scss"],
+ templateUrl: "./cert-author.component.html"
+})
+export class CertAuthorComponent {
+ @Input() public author: Author | undefined;
Review Comment:
I don't think this component serves any purpose or function without an
author to display - why make it optional?
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.html:
##########
@@ -0,0 +1,68 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<div>
+ <div class="mat-elevation-z2">
+ <h2>Issuer</h2>
+ <tp-cert-author [author]="issuer"></tp-cert-author>
+ </div>
+ <div class="mat-elevation-z2">
+ <h2>Subject</h2>
+ <tp-cert-author [author]="subject"></tp-cert-author>
+ </div>
+ <div class="mat-elevation-z2">
+ <h2>Validity</h2>
+ <div class="content">
+ <div class="double">
+ <mat-form-field>
+ <mat-label>Not Valid Before</mat-label>
+ <input matInput type="date"
[formControl]="validBeforeFormControl" name="validBefore" readonly />
+ <mat-error
*ngIf="validBeforeFormControl.hasError('notValid')">Not currently
valid</mat-error>
+ </mat-form-field>
+ <mat-form-field>
+ <mat-label>Not Valid After</mat-label>
+ <input matInput type="date"
[formControl]="validAfterFormControl" name="validAfter" readonly />
+ <mat-error
*ngIf="validAfterFormControl.hasError('notValid')">Not currently
valid</mat-error>
+ </mat-form-field>
+ </div>
+ </div>
+ </div>
+ <div class="mat-elevation-z2">
+ <h2>Misc</h2>
+ <div class="content">
+ <div class="double"></div>
+ <mat-form-field>
+ <mat-label>Signature Algorithm</mat-label>
+ <input matInput type="text" name="sigType"
readonly [value]="oidToName(cert.signatureOid)"/>
+ </mat-form-field>
+ <div class="squished">
+ <mat-form-field>
+ <mat-label>Version</mat-label>
+ <input matInput type="number"
name="version" readonly value="{{cert.version}}"/>
Review Comment:
every other one uses the `[attribute]="property"` syntax, this one is using
`attribute="{{property}}"` - why?
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.ts:
##########
@@ -0,0 +1,134 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+import { Component, Input, OnChanges } from "@angular/core";
+import { AbstractControl, FormControl, ValidationErrors, ValidatorFn } from
"@angular/forms";
+import * as forge from "node-forge";
+import { Hex } from "node-forge";
+
+import { oidToName, pkiCertToSHA1, pkiCertToSHA256 } from
"src/app/core/certs/cert.util";
+
+/**
+ * Author contains the information about an author from a cert issuer/subject
+ */
+export interface Author {
+ countryName?: string | undefined;
+ stateOrProvince?: string | undefined;
+ localityName?: string | undefined;
+ orgName?: string | undefined;
+ orgUnit?: string | undefined;
+ commonName: string;
+}
+
+/**
+ * Angular validator that checks if the value is either before or after the
given time
+ *
+ * @param before If this is only valid before
+ * @param now The time to compare against
+ * @returns Validator Function
+ */
+function createDateValidator(before: boolean, now: Date): ValidatorFn {
+ return (control: AbstractControl): ValidationErrors | null => {
+ const value = control.value;
+ if (!value) {
+ return null;
+ }
+
+ let valid = false;
+ const d = new Date(value);
+ if (before) {
+ valid = now >= d;
+ } else {
+ valid = now <= d;
+ }
+
+ return valid ? null : {notValid: true};
Review Comment:
`notValid` is a pretty vague validation error. Any validation error at all
would make a control "not valid", which is why others use e.g. `required`,
`max-length` etc.
##########
experimental/traffic-portal/src/app/core/certs/cert-author/cert-author.component.ts:
##########
@@ -0,0 +1,30 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import { Component, Input } from "@angular/core";
+
+import { Author } from "src/app/core/certs/cert-detail/cert-detail.component";
Review Comment:
Nit: could be `import type ...`
##########
experimental/traffic-portal/src/app/core/certs/cert-viewer/cert-viewer.component.ts:
##########
@@ -0,0 +1,187 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+import { Component, OnInit, ViewChild } from "@angular/core";
+import { FormControl } from "@angular/forms";
+import { MatTabGroup } from "@angular/material/tabs";
+import { ActivatedRoute } from "@angular/router";
+import * as forge from "node-forge";
+import { ResponseDeliveryServiceSSLKey } from "trafficops-types";
Review Comment:
Nit: could be `import type...`
##########
experimental/traffic-portal/src/app/core/certs/cert-detail/cert-detail.component.ts:
##########
@@ -0,0 +1,134 @@
+/*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+import { Component, Input, OnChanges } from "@angular/core";
+import { AbstractControl, FormControl, ValidationErrors, ValidatorFn } from
"@angular/forms";
+import * as forge from "node-forge";
+import { Hex } from "node-forge";
+
+import { oidToName, pkiCertToSHA1, pkiCertToSHA256 } from
"src/app/core/certs/cert.util";
+
+/**
+ * Author contains the information about an author from a cert issuer/subject
+ */
+export interface Author {
+ countryName?: string | undefined;
+ stateOrProvince?: string | undefined;
+ localityName?: string | undefined;
+ orgName?: string | undefined;
+ orgUnit?: string | undefined;
+ commonName: string;
+}
+
+/**
+ * Angular validator that checks if the value is either before or after the
given time
+ *
+ * @param before If this is only valid before
+ * @param now The time to compare against
+ * @returns Validator Function
+ */
+function createDateValidator(before: boolean, now: Date): ValidatorFn {
+ return (control: AbstractControl): ValidationErrors | null => {
+ const value = control.value;
+ if (!value) {
+ return null;
+ }
+
+ let valid = false;
+ const d = new Date(value);
+ if (before) {
+ valid = now >= d;
+ } else {
+ valid = now <= d;
+ }
+
+ return valid ? null : {notValid: true};
+ };
+}
+
+/**
+ * Controller for the Cert Detail component
+ */
+@Component({
+ selector: "tp-cert-detail",
+ styleUrls: ["./cert-detail.component.scss"],
+ templateUrl: "./cert-detail.component.html"
+})
+export class CertDetailComponent implements OnChanges {
+ @Input() public cert!: forge.pki.Certificate;
+
+ public issuer: Author = {commonName: ""};
+ public subject: Author = {commonName: ""};
+ public now: Date = new Date();
+ public validAfterFormControl = new FormControl<string>("",
[createDateValidator(false, this.now)]);
+ public validBeforeFormControl = new FormControl<string>("",
[createDateValidator(true, this.now)]);
+
+ public sha1: Hex = "";
+ public sha256: Hex = "";
+
+ /**
+ * processAttributes converts attributes into an author
+ *
+ * @param attrs The attributes to process
+ * @returns The resultant author
+ */
+ public processAttributes(attrs: forge.pki.CertificateField[]): Author {
+ const a: Author = {commonName: ""};
+ for (const attr of attrs) {
+ if (attr.name && attr.value) {
+ if (typeof attr.value !== "string") {
+ console.log(`Unknown attribute value
${attr.value}`);
Review Comment:
warning?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]