mirror of https://github.com/goharbor/harbor.git
Compare commits
7 Commits
6fe8b75cf9
...
9690edfa04
Author | SHA1 | Date |
---|---|---|
stonezdj(Daojun Zhang) | 9690edfa04 | |
Shengwen YU | 9471f5d5a6 | |
Lichao Xue | dee73a44f3 | |
Shengwen YU | c791b39a26 | |
Shengwen YU | 822784aac8 | |
Shengwen YU | d0cb200ed5 | |
stonezdj | ad102f75ee |
|
@ -77,8 +77,8 @@ const (
|
||||||
// TypeSubject ...
|
// TypeSubject ...
|
||||||
TypeSubject = "subject.accessory"
|
TypeSubject = "subject.accessory"
|
||||||
|
|
||||||
// TypeHarborSBOM identifies harbor.sbom
|
// TypeHarborSBOM identifies sbom.harbor
|
||||||
TypeHarborSBOM = "harbor.sbom"
|
TypeHarborSBOM = "sbom.harbor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AccessoryData ...
|
// AccessoryData ...
|
||||||
|
|
|
@ -78,6 +78,7 @@ export const ACTION_RESOURCE_I18N_MAP = {
|
||||||
log: 'ROBOT_ACCOUNT.LOG',
|
log: 'ROBOT_ACCOUNT.LOG',
|
||||||
'notification-policy': 'ROBOT_ACCOUNT.NOTIFICATION_POLICY',
|
'notification-policy': 'ROBOT_ACCOUNT.NOTIFICATION_POLICY',
|
||||||
quota: 'ROBOT_ACCOUNT.QUOTA',
|
quota: 'ROBOT_ACCOUNT.QUOTA',
|
||||||
|
sbom: 'ROBOT_ACCOUNT.SBOM',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function convertKey(key: string) {
|
export function convertKey(key: string) {
|
||||||
|
|
|
@ -13,10 +13,13 @@
|
||||||
[clrIfActive]="currentTabLinkId === 'vulnerability'">
|
[clrIfActive]="currentTabLinkId === 'vulnerability'">
|
||||||
<clr-tab-content id="vulnerability-content">
|
<clr-tab-content id="vulnerability-content">
|
||||||
<hbr-artifact-vulnerabilities
|
<hbr-artifact-vulnerabilities
|
||||||
|
*ngIf="currentTabLinkId === 'vulnerability'"
|
||||||
[artifact]="artifact"
|
[artifact]="artifact"
|
||||||
[projectName]="projectName"
|
[projectName]="projectName"
|
||||||
[projectId]="projectId"
|
[projectId]="projectId"
|
||||||
[repoName]="repoName"
|
[repoName]="repoName"
|
||||||
|
[scanBtnState]="getScanBtnState()"
|
||||||
|
[hasEnabledScanner]="hasEnabledScanner()"
|
||||||
[digest]="digest"
|
[digest]="digest"
|
||||||
[vulnerabilitiesLink]="
|
[vulnerabilitiesLink]="
|
||||||
getVulnerability()
|
getVulnerability()
|
||||||
|
@ -24,16 +27,18 @@
|
||||||
</clr-tab-content>
|
</clr-tab-content>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</clr-tab>
|
</clr-tab>
|
||||||
<clr-tab *ngIf="getSbom()">
|
<clr-tab *ngIf="hasScannerSupportSBOM()">
|
||||||
<button clrTabLink id="sbom" (click)="actionTab('sbom')">
|
<button clrTabLink id="sbom" (click)="actionTab('sbom')">
|
||||||
{{ 'REPOSITORY.SBOM' | translate }}
|
{{ 'REPOSITORY.SBOM' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<ng-template [clrIfActive]="currentTabLinkId === 'sbom'">
|
<ng-template [clrIfActive]="currentTabLinkId === 'sbom'">
|
||||||
<clr-tab-content id="sbom-content">
|
<clr-tab-content id="sbom-content">
|
||||||
<hbr-artifact-sbom
|
<hbr-artifact-sbom
|
||||||
|
*ngIf="currentTabLinkId === 'sbom'"
|
||||||
[artifact]="artifact"
|
[artifact]="artifact"
|
||||||
[projectName]="projectName"
|
[projectName]="projectName"
|
||||||
[projectId]="projectId"
|
[projectId]="projectId"
|
||||||
|
[hasScannerSupportSBOM]="hasScannerSupportSBOM()"
|
||||||
[repoName]="repoName"
|
[repoName]="repoName"
|
||||||
[sbomDigest]="sbomDigest"></hbr-artifact-sbom>
|
[sbomDigest]="sbomDigest"></hbr-artifact-sbom>
|
||||||
</clr-tab-content>
|
</clr-tab-content>
|
||||||
|
@ -50,6 +55,7 @@
|
||||||
[clrIfActive]="currentTabLinkId === 'build-history'">
|
[clrIfActive]="currentTabLinkId === 'build-history'">
|
||||||
<clr-tab-content>
|
<clr-tab-content>
|
||||||
<hbr-artifact-build-history
|
<hbr-artifact-build-history
|
||||||
|
*ngIf="currentTabLinkId === 'build-history'"
|
||||||
[buildHistoryLink]="
|
[buildHistoryLink]="
|
||||||
getBuildHistory()
|
getBuildHistory()
|
||||||
"></hbr-artifact-build-history>
|
"></hbr-artifact-build-history>
|
||||||
|
@ -67,6 +73,7 @@
|
||||||
[clrIfActive]="currentTabLinkId === 'summary-link'">
|
[clrIfActive]="currentTabLinkId === 'summary-link'">
|
||||||
<clr-tab-content id="summary-content">
|
<clr-tab-content id="summary-content">
|
||||||
<hbr-artifact-summary
|
<hbr-artifact-summary
|
||||||
|
*ngIf="currentTabLinkId === 'summary-link'"
|
||||||
[summaryLink]="getSummary()"></hbr-artifact-summary>
|
[summaryLink]="getSummary()"></hbr-artifact-summary>
|
||||||
</clr-tab-content>
|
</clr-tab-content>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@ -81,6 +88,7 @@
|
||||||
<ng-template [clrIfActive]="currentTabLinkId === 'depend-link'">
|
<ng-template [clrIfActive]="currentTabLinkId === 'depend-link'">
|
||||||
<clr-tab-content id="depend-content">
|
<clr-tab-content id="depend-content">
|
||||||
<hbr-artifact-dependencies
|
<hbr-artifact-dependencies
|
||||||
|
*ngIf="currentTabLinkId === 'depend-link'"
|
||||||
[dependenciesLink]="
|
[dependenciesLink]="
|
||||||
getDependencies()
|
getDependencies()
|
||||||
"></hbr-artifact-dependencies>
|
"></hbr-artifact-dependencies>
|
||||||
|
@ -97,6 +105,7 @@
|
||||||
<ng-template [clrIfActive]="currentTabLinkId === 'value-link'">
|
<ng-template [clrIfActive]="currentTabLinkId === 'value-link'">
|
||||||
<clr-tab-content id="value-content">
|
<clr-tab-content id="value-content">
|
||||||
<hbr-artifact-values
|
<hbr-artifact-values
|
||||||
|
*ngIf="currentTabLinkId === 'value-link'"
|
||||||
[valuesLink]="getValues()"></hbr-artifact-values>
|
[valuesLink]="getValues()"></hbr-artifact-values>
|
||||||
</clr-tab-content>
|
</clr-tab-content>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -4,6 +4,8 @@ import { AdditionLinks } from '../../../../../../../ng-swagger-gen/models/additi
|
||||||
import { CURRENT_BASE_HREF } from '../../../../../shared/units/utils';
|
import { CURRENT_BASE_HREF } from '../../../../../shared/units/utils';
|
||||||
import { SharedTestingModule } from '../../../../../shared/shared.module';
|
import { SharedTestingModule } from '../../../../../shared/shared.module';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
import { ArtifactListPageService } from '../artifact-list-page/artifact-list-page.service';
|
||||||
|
import { ClrLoadingState } from '@clr/angular';
|
||||||
|
|
||||||
describe('ArtifactAdditionsComponent', () => {
|
describe('ArtifactAdditionsComponent', () => {
|
||||||
const mockedAdditionLinks: AdditionLinks = {
|
const mockedAdditionLinks: AdditionLinks = {
|
||||||
|
@ -12,6 +14,18 @@ describe('ArtifactAdditionsComponent', () => {
|
||||||
href: CURRENT_BASE_HREF + '/test',
|
href: CURRENT_BASE_HREF + '/test',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const mockedArtifactListPageService = {
|
||||||
|
hasScannerSupportSBOM(): boolean {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
hasEnabledScanner(): boolean {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
getScanBtnState(): ClrLoadingState {
|
||||||
|
return ClrLoadingState.SUCCESS;
|
||||||
|
},
|
||||||
|
init() {},
|
||||||
|
};
|
||||||
let component: ArtifactAdditionsComponent;
|
let component: ArtifactAdditionsComponent;
|
||||||
let fixture: ComponentFixture<ArtifactAdditionsComponent>;
|
let fixture: ComponentFixture<ArtifactAdditionsComponent>;
|
||||||
|
|
||||||
|
@ -20,6 +34,12 @@ describe('ArtifactAdditionsComponent', () => {
|
||||||
imports: [SharedTestingModule],
|
imports: [SharedTestingModule],
|
||||||
declarations: [ArtifactAdditionsComponent],
|
declarations: [ArtifactAdditionsComponent],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: ArtifactListPageService,
|
||||||
|
useValue: mockedArtifactListPageService,
|
||||||
|
},
|
||||||
|
],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -27,6 +47,7 @@ describe('ArtifactAdditionsComponent', () => {
|
||||||
fixture = TestBed.createComponent(ArtifactAdditionsComponent);
|
fixture = TestBed.createComponent(ArtifactAdditionsComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
component.additionLinks = mockedAdditionLinks;
|
component.additionLinks = mockedAdditionLinks;
|
||||||
|
component.tab = 'vulnerability';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@ import { ADDITIONS } from './models';
|
||||||
import { AdditionLinks } from '../../../../../../../ng-swagger-gen/models/addition-links';
|
import { AdditionLinks } from '../../../../../../../ng-swagger-gen/models/addition-links';
|
||||||
import { AdditionLink } from '../../../../../../../ng-swagger-gen/models/addition-link';
|
import { AdditionLink } from '../../../../../../../ng-swagger-gen/models/addition-link';
|
||||||
import { Artifact } from '../../../../../../../ng-swagger-gen/models/artifact';
|
import { Artifact } from '../../../../../../../ng-swagger-gen/models/artifact';
|
||||||
import { ClrTabs } from '@clr/angular';
|
import { ClrLoadingState, ClrTabs } from '@clr/angular';
|
||||||
|
import { ArtifactListPageService } from '../artifact-list-page/artifact-list-page.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'artifact-additions',
|
selector: 'artifact-additions',
|
||||||
|
@ -32,14 +33,21 @@ export class ArtifactAdditionsComponent implements AfterViewChecked, OnInit {
|
||||||
@Input()
|
@Input()
|
||||||
tab: string;
|
tab: string;
|
||||||
|
|
||||||
@Input() currentTabLinkId: string = 'vulnerability';
|
@Input() currentTabLinkId: string = '';
|
||||||
activeTab: string = null;
|
activeTab: string = null;
|
||||||
|
|
||||||
@ViewChild('additionsTab') tabs: ClrTabs;
|
@ViewChild('additionsTab') tabs: ClrTabs;
|
||||||
constructor(private ref: ChangeDetectorRef) {}
|
constructor(
|
||||||
|
private ref: ChangeDetectorRef,
|
||||||
|
private artifactListPageService: ArtifactListPageService
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.activeTab = this.tab;
|
this.activeTab = this.tab;
|
||||||
|
if (!this.activeTab) {
|
||||||
|
this.currentTabLinkId = 'vulnerability';
|
||||||
|
}
|
||||||
|
this.artifactListPageService.init(this.projectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewChecked() {
|
ngAfterViewChecked() {
|
||||||
|
@ -50,6 +58,10 @@ export class ArtifactAdditionsComponent implements AfterViewChecked, OnInit {
|
||||||
this.ref.detectChanges();
|
this.ref.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasScannerSupportSBOM(): boolean {
|
||||||
|
return this.artifactListPageService.hasScannerSupportSBOM();
|
||||||
|
}
|
||||||
|
|
||||||
getVulnerability(): AdditionLink {
|
getVulnerability(): AdditionLink {
|
||||||
if (
|
if (
|
||||||
this.additionLinks &&
|
this.additionLinks &&
|
||||||
|
@ -59,12 +71,7 @@ export class ArtifactAdditionsComponent implements AfterViewChecked, OnInit {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
getSbom(): AdditionLink {
|
|
||||||
if (this.additionLinks && this.additionLinks[ADDITIONS.SBOMS]) {
|
|
||||||
return this.additionLinks[ADDITIONS.SBOMS];
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
getBuildHistory(): AdditionLink {
|
getBuildHistory(): AdditionLink {
|
||||||
if (this.additionLinks && this.additionLinks[ADDITIONS.BUILD_HISTORY]) {
|
if (this.additionLinks && this.additionLinks[ADDITIONS.BUILD_HISTORY]) {
|
||||||
return this.additionLinks[ADDITIONS.BUILD_HISTORY];
|
return this.additionLinks[ADDITIONS.BUILD_HISTORY];
|
||||||
|
@ -93,4 +100,12 @@ export class ArtifactAdditionsComponent implements AfterViewChecked, OnInit {
|
||||||
actionTab(tab: string): void {
|
actionTab(tab: string): void {
|
||||||
this.currentTabLinkId = tab;
|
this.currentTabLinkId = tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getScanBtnState(): ClrLoadingState {
|
||||||
|
return this.artifactListPageService.getScanBtnState();
|
||||||
|
}
|
||||||
|
|
||||||
|
hasEnabledScanner(): boolean {
|
||||||
|
return this.artifactListPageService.hasEnabledScanner();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</clr-dg-action-bar>
|
</clr-dg-action-bar>
|
||||||
<clr-dg-column [clrDgField]="'package'" class="package-medium">{{
|
<clr-dg-column
|
||||||
'SBOM.GRID.COLUMN_PACKAGE' | translate
|
[clrDgSortBy]="'name'"
|
||||||
}}</clr-dg-column>
|
[clrDgField]="'name'"
|
||||||
<clr-dg-column [clrDgField]="'version'" class="version-medium">{{
|
class="package-medium"
|
||||||
'SBOM.GRID.COLUMN_VERSION' | translate
|
>{{ 'SBOM.GRID.COLUMN_PACKAGE' | translate }}</clr-dg-column
|
||||||
}}</clr-dg-column>
|
>
|
||||||
|
<clr-dg-column
|
||||||
|
[clrDgSortBy]="'versionInfo'"
|
||||||
|
[clrDgField]="'versionInfo'"
|
||||||
|
class="version-medium"
|
||||||
|
>{{ 'SBOM.GRID.COLUMN_VERSION' | translate }}</clr-dg-column
|
||||||
|
>
|
||||||
<clr-dg-column>{{
|
<clr-dg-column>{{
|
||||||
'SBOM.GRID.COLUMN_LICENSE' | translate
|
'SBOM.GRID.COLUMN_LICENSE' | translate
|
||||||
}}</clr-dg-column>
|
}}</clr-dg-column>
|
||||||
|
|
|
@ -10,7 +10,6 @@ import {
|
||||||
} from '@ngx-translate/core';
|
} from '@ngx-translate/core';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { UserPermissionService } from '../../../../../../shared/services';
|
import { UserPermissionService } from '../../../../../../shared/services';
|
||||||
import { AdditionLink } from '../../../../../../../../ng-swagger-gen/models/addition-link';
|
|
||||||
import { ErrorHandler } from '../../../../../../shared/units/error-handler';
|
import { ErrorHandler } from '../../../../../../shared/units/error-handler';
|
||||||
import { SessionService } from '../../../../../../shared/services/session.service';
|
import { SessionService } from '../../../../../../shared/services/session.service';
|
||||||
import { SessionUser } from '../../../../../../shared/entities/session-user';
|
import { SessionUser } from '../../../../../../shared/entities/session-user';
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
import {
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
AfterViewInit,
|
|
||||||
Component,
|
|
||||||
Input,
|
|
||||||
OnDestroy,
|
|
||||||
OnInit,
|
|
||||||
} from '@angular/core';
|
|
||||||
import { ClrDatagridStateInterface, ClrLoadingState } from '@clr/angular';
|
import { ClrDatagridStateInterface, ClrLoadingState } from '@clr/angular';
|
||||||
import { finalize } from 'rxjs/operators';
|
import { finalize } from 'rxjs/operators';
|
||||||
import { AdditionLink } from '../../../../../../../../ng-swagger-gen/models/addition-link';
|
|
||||||
import {
|
import {
|
||||||
ScannerVo,
|
ScannerVo,
|
||||||
UserPermissionService,
|
UserPermissionService,
|
||||||
|
@ -30,7 +23,6 @@ import {
|
||||||
HarborEvent,
|
HarborEvent,
|
||||||
} from '../../../../../../services/event-service/event.service';
|
} from '../../../../../../services/event-service/event.service';
|
||||||
import { severityText } from '../../../../../left-side-nav/interrogation-services/vulnerability-database/security-hub.interface';
|
import { severityText } from '../../../../../left-side-nav/interrogation-services/vulnerability-database/security-hub.interface';
|
||||||
import { AppConfigService } from 'src/app/services/app-config.service';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ArtifactSbom,
|
ArtifactSbom,
|
||||||
|
@ -38,8 +30,7 @@ import {
|
||||||
getArtifactSbom,
|
getArtifactSbom,
|
||||||
} from '../../artifact';
|
} from '../../artifact';
|
||||||
import { ArtifactService } from 'ng-swagger-gen/services';
|
import { ArtifactService } from 'ng-swagger-gen/services';
|
||||||
import { ScanTypes } from 'src/app/shared/entities/shared.const';
|
import { ScanTypes } from '../../../../../../shared/entities/shared.const';
|
||||||
import { ArtifactListPageService } from '../../artifact-list-page/artifact-list-page.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hbr-artifact-sbom',
|
selector: 'hbr-artifact-sbom',
|
||||||
|
@ -56,13 +47,12 @@ export class ArtifactSbomComponent implements OnInit, OnDestroy {
|
||||||
@Input()
|
@Input()
|
||||||
sbomDigest: string;
|
sbomDigest: string;
|
||||||
@Input() artifact: Artifact;
|
@Input() artifact: Artifact;
|
||||||
|
@Input() hasScannerSupportSBOM: boolean = false;
|
||||||
|
|
||||||
artifactSbom: ArtifactSbom;
|
artifactSbom: ArtifactSbom;
|
||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
hasScannerSupportSBOM: boolean = false;
|
|
||||||
downloadSbomBtnState: ClrLoadingState = ClrLoadingState.DEFAULT;
|
downloadSbomBtnState: ClrLoadingState = ClrLoadingState.DEFAULT;
|
||||||
hasSbomPermission: boolean = false;
|
hasSbomPermission: boolean = false;
|
||||||
|
|
||||||
hasShowLoading: boolean = false;
|
hasShowLoading: boolean = false;
|
||||||
sub: Subscription;
|
sub: Subscription;
|
||||||
hasViewInitWithDelay: boolean = false;
|
hasViewInitWithDelay: boolean = false;
|
||||||
|
@ -73,16 +63,13 @@ export class ArtifactSbomComponent implements OnInit, OnDestroy {
|
||||||
readonly severityText = severityText;
|
readonly severityText = severityText;
|
||||||
constructor(
|
constructor(
|
||||||
private errorHandler: ErrorHandler,
|
private errorHandler: ErrorHandler,
|
||||||
private appConfigService: AppConfigService,
|
|
||||||
private artifactService: ArtifactService,
|
private artifactService: ArtifactService,
|
||||||
private artifactListPageService: ArtifactListPageService,
|
|
||||||
private userPermissionService: UserPermissionService,
|
private userPermissionService: UserPermissionService,
|
||||||
private eventService: EventService,
|
private eventService: EventService,
|
||||||
private session: SessionService
|
private session: SessionService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.artifactListPageService.init(this.projectId);
|
|
||||||
this.getSbom();
|
this.getSbom();
|
||||||
this.getSbomPermission();
|
this.getSbomPermission();
|
||||||
if (!this.sub) {
|
if (!this.sub) {
|
||||||
|
@ -222,8 +209,6 @@ export class ArtifactSbomComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
canDownloadSbom(): boolean {
|
canDownloadSbom(): boolean {
|
||||||
this.hasScannerSupportSBOM =
|
|
||||||
this.artifactListPageService.hasScannerSupportSBOM();
|
|
||||||
return (
|
return (
|
||||||
this.hasScannerSupportSBOM &&
|
this.hasScannerSupportSBOM &&
|
||||||
//this.hasSbomPermission &&
|
//this.hasSbomPermission &&
|
||||||
|
@ -234,7 +219,12 @@ export class ArtifactSbomComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
artifactSbomPackages(): ArtifactSbomPackageItem[] {
|
artifactSbomPackages(): ArtifactSbomPackageItem[] {
|
||||||
return this.artifactSbom?.sbomPackage?.packages ?? [];
|
return (
|
||||||
|
this.artifactSbom?.sbomPackage?.packages?.filter(
|
||||||
|
item =>
|
||||||
|
item?.name || item?.versionInfo || item?.licenseConcluded
|
||||||
|
) ?? []
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
load(state: ClrDatagridStateInterface) {
|
load(state: ClrDatagridStateInterface) {
|
||||||
|
|
|
@ -50,14 +50,13 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy {
|
||||||
@Input()
|
@Input()
|
||||||
digest: string;
|
digest: string;
|
||||||
@Input() artifact: Artifact;
|
@Input() artifact: Artifact;
|
||||||
|
@Input() scanBtnState: ClrLoadingState = ClrLoadingState.DEFAULT;
|
||||||
|
@Input() hasEnabledScanner: boolean = false;
|
||||||
scan_overview: any;
|
scan_overview: any;
|
||||||
scanner: ScannerVo;
|
scanner: ScannerVo;
|
||||||
projectScanner: ScannerVo;
|
|
||||||
|
|
||||||
scanningResults: VulnerabilityItem[] = [];
|
scanningResults: VulnerabilityItem[] = [];
|
||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
hasEnabledScanner: boolean = false;
|
|
||||||
scanBtnState: ClrLoadingState = ClrLoadingState.DEFAULT;
|
|
||||||
severitySort: ClrDatagridComparatorInterface<VulnerabilityItem>;
|
severitySort: ClrDatagridComparatorInterface<VulnerabilityItem>;
|
||||||
cvssSort: ClrDatagridComparatorInterface<VulnerabilityItem>;
|
cvssSort: ClrDatagridComparatorInterface<VulnerabilityItem>;
|
||||||
hasScanningPermission: boolean = false;
|
hasScanningPermission: boolean = false;
|
||||||
|
@ -112,7 +111,6 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy {
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getVulnerabilities();
|
this.getVulnerabilities();
|
||||||
this.getScanningPermission();
|
this.getScanningPermission();
|
||||||
this.getProjectScanner();
|
|
||||||
if (!this.sub) {
|
if (!this.sub) {
|
||||||
this.sub = this.eventService.subscribe(
|
this.sub = this.eventService.subscribe(
|
||||||
HarborEvent.UPDATE_VULNERABILITY_INFO,
|
HarborEvent.UPDATE_VULNERABILITY_INFO,
|
||||||
|
@ -203,30 +201,6 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getProjectScanner(): void {
|
|
||||||
this.hasEnabledScanner = false;
|
|
||||||
this.scanBtnState = ClrLoadingState.LOADING;
|
|
||||||
this.scanningService.getProjectScanner(this.projectId).subscribe(
|
|
||||||
response => {
|
|
||||||
if (
|
|
||||||
response &&
|
|
||||||
'{}' !== JSON.stringify(response) &&
|
|
||||||
!response.disabled &&
|
|
||||||
response.health === 'healthy'
|
|
||||||
) {
|
|
||||||
this.scanBtnState = ClrLoadingState.SUCCESS;
|
|
||||||
this.hasEnabledScanner = true;
|
|
||||||
} else {
|
|
||||||
this.scanBtnState = ClrLoadingState.ERROR;
|
|
||||||
}
|
|
||||||
this.projectScanner = response;
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
this.scanBtnState = ClrLoadingState.ERROR;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
getLevel(v: VulnerabilityItem): number {
|
getLevel(v: VulnerabilityItem): number {
|
||||||
if (v && v.severity && SEVERITY_LEVEL_MAP[v.severity]) {
|
if (v && v.severity && SEVERITY_LEVEL_MAP[v.severity]) {
|
||||||
return SEVERITY_LEVEL_MAP[v.severity];
|
return SEVERITY_LEVEL_MAP[v.severity];
|
||||||
|
|
|
@ -65,10 +65,6 @@
|
||||||
class="action-dropdown"
|
class="action-dropdown"
|
||||||
clrPosition="bottom-left"
|
clrPosition="bottom-left"
|
||||||
*clrIfOpen>
|
*clrIfOpen>
|
||||||
<div
|
|
||||||
class="dropdown-divider"
|
|
||||||
role="separator"
|
|
||||||
aria-hidden="true"></div>
|
|
||||||
<button
|
<button
|
||||||
clrDropdownItem
|
clrDropdownItem
|
||||||
id="stop-scan"
|
id="stop-scan"
|
||||||
|
|
|
@ -1099,7 +1099,7 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
||||||
res?.filter(
|
res?.filter(
|
||||||
item =>
|
item =>
|
||||||
item.type === AccessoryType.SBOM
|
item.type === AccessoryType.SBOM
|
||||||
)?.[0]?.digest ?? null;
|
)?.[0]?.digest ?? undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: err => {
|
error: err => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Accessory } from 'ng-swagger-gen/models/accessory';
|
import {Accessory} from 'ng-swagger-gen/models/accessory';
|
||||||
import { Artifact } from '../../../../../../ng-swagger-gen/models/artifact';
|
import {Artifact} from '../../../../../../ng-swagger-gen/models/artifact';
|
||||||
import { Platform } from '../../../../../../ng-swagger-gen/models/platform';
|
import {Platform} from '../../../../../../ng-swagger-gen/models/platform';
|
||||||
import { Label } from '../../../../../../ng-swagger-gen/models/label';
|
import {Label} from '../../../../../../ng-swagger-gen/models/label';
|
||||||
|
|
||||||
export interface ArtifactFront extends Artifact {
|
export interface ArtifactFront extends Artifact {
|
||||||
platform?: Platform;
|
platform?: Platform;
|
||||||
|
@ -76,7 +76,7 @@ export enum AccessoryType {
|
||||||
COSIGN = 'signature.cosign',
|
COSIGN = 'signature.cosign',
|
||||||
NOTATION = 'signature.notation',
|
NOTATION = 'signature.notation',
|
||||||
NYDUS = 'accelerator.nydus',
|
NYDUS = 'accelerator.nydus',
|
||||||
SBOM = 'harbor.sbom',
|
SBOM = 'sbom.harbor',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ArtifactType {
|
export enum ArtifactType {
|
||||||
|
|
|
@ -68,9 +68,7 @@ export class SbomTipHistogramComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
get noSbom(): boolean {
|
get noSbom(): boolean {
|
||||||
return (
|
return this.sbomDigest === undefined || this.sbomDigest === '';
|
||||||
this.sbomSummary.scan_status === SBOM_SCAN_STATUS.NOT_GENERATED_SBOM
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isThemeLight() {
|
isThemeLight() {
|
||||||
|
|
|
@ -142,7 +142,16 @@ export const errorHandler = function (error: any): string {
|
||||||
}
|
}
|
||||||
// Not a standard error return Basically not used cover unknown error
|
// Not a standard error return Basically not used cover unknown error
|
||||||
try {
|
try {
|
||||||
return JSON.parse(error.error).message;
|
const jsonError = JSON.parse(error.error);
|
||||||
|
if (jsonError.errors && jsonError.errors instanceof Array) {
|
||||||
|
return (
|
||||||
|
jsonError.errors?.map(error => error.message) ?? [
|
||||||
|
'UNKNOWN_ERROR',
|
||||||
|
]
|
||||||
|
).join(',');
|
||||||
|
} else {
|
||||||
|
return JSON.parse(error.error).message;
|
||||||
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
// Not a standard error return Basically not used cover unknown error
|
// Not a standard error return Basically not used cover unknown error
|
||||||
if (typeof error.error === 'string') {
|
if (typeof error.error === 'string') {
|
||||||
|
|
|
@ -406,6 +406,7 @@
|
||||||
"REPOSITORY": "Repository",
|
"REPOSITORY": "Repository",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessory",
|
"ACCESSORY": "Accessory",
|
||||||
"ARTIFACT_ADDITION": "Artifact Addition",
|
"ARTIFACT_ADDITION": "Artifact Addition",
|
||||||
|
@ -1061,7 +1062,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -406,6 +406,7 @@
|
||||||
"REPOSITORY": "Repository",
|
"REPOSITORY": "Repository",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessory",
|
"ACCESSORY": "Accessory",
|
||||||
"ARTIFACT_ADDITION": "Artifact Addition",
|
"ARTIFACT_ADDITION": "Artifact Addition",
|
||||||
|
@ -1062,7 +1063,7 @@
|
||||||
"GENERATE": "Generate SBOM ",
|
"GENERATE": "Generate SBOM ",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -407,6 +407,7 @@
|
||||||
"REPOSITORY": "Repository",
|
"REPOSITORY": "Repository",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessory",
|
"ACCESSORY": "Accessory",
|
||||||
"ARTIFACT_ADDITION": "Artifact Addition",
|
"ARTIFACT_ADDITION": "Artifact Addition",
|
||||||
|
@ -1060,7 +1061,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -406,6 +406,7 @@
|
||||||
"REPOSITORY": "Dépôt",
|
"REPOSITORY": "Dépôt",
|
||||||
"ARTIFACT": "Artefact",
|
"ARTIFACT": "Artefact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessoire",
|
"ACCESSORY": "Accessoire",
|
||||||
"ARTIFACT_ADDITION": "Artefact Addition",
|
"ARTIFACT_ADDITION": "Artefact Addition",
|
||||||
|
@ -1060,7 +1061,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -403,6 +403,7 @@
|
||||||
"REPOSITORY": "저장소",
|
"REPOSITORY": "저장소",
|
||||||
"ARTIFACT": "아티팩트",
|
"ARTIFACT": "아티팩트",
|
||||||
"SCAN": "스캔",
|
"SCAN": "스캔",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "태그",
|
"TAG": "태그",
|
||||||
"ACCESSORY": "액세서리",
|
"ACCESSORY": "액세서리",
|
||||||
"ARTIFACT_ADDITION": "아티팩트 추가",
|
"ARTIFACT_ADDITION": "아티팩트 추가",
|
||||||
|
@ -1059,7 +1060,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -404,6 +404,7 @@
|
||||||
"REPOSITORY": "Repository",
|
"REPOSITORY": "Repository",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessory",
|
"ACCESSORY": "Accessory",
|
||||||
"ARTIFACT_ADDITION": "Artifact Addition",
|
"ARTIFACT_ADDITION": "Artifact Addition",
|
||||||
|
@ -1058,7 +1059,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -406,6 +406,7 @@
|
||||||
"REPOSITORY": "Repository",
|
"REPOSITORY": "Repository",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessory",
|
"ACCESSORY": "Accessory",
|
||||||
"ARTIFACT_ADDITION": "Artifact Addition",
|
"ARTIFACT_ADDITION": "Artifact Addition",
|
||||||
|
@ -1061,7 +1062,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -405,6 +405,7 @@
|
||||||
"REPOSITORY": "仓库",
|
"REPOSITORY": "仓库",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "扫描",
|
"SCAN": "扫描",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "附件",
|
"ACCESSORY": "附件",
|
||||||
"ARTIFACT_ADDITION": "Artifact 额外信息",
|
"ARTIFACT_ADDITION": "Artifact 额外信息",
|
||||||
|
@ -1059,7 +1060,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -405,6 +405,7 @@
|
||||||
"REPOSITORY": "Repository",
|
"REPOSITORY": "Repository",
|
||||||
"ARTIFACT": "Artifact",
|
"ARTIFACT": "Artifact",
|
||||||
"SCAN": "Scan",
|
"SCAN": "Scan",
|
||||||
|
"SBOM": "SBOM",
|
||||||
"TAG": "Tag",
|
"TAG": "Tag",
|
||||||
"ACCESSORY": "Accessory",
|
"ACCESSORY": "Accessory",
|
||||||
"ARTIFACT_ADDITION": "Artifact Addition",
|
"ARTIFACT_ADDITION": "Artifact Addition",
|
||||||
|
@ -1058,7 +1059,7 @@
|
||||||
"GENERATE": "Generate SBOM",
|
"GENERATE": "Generate SBOM",
|
||||||
"DOWNLOAD": "Download SBOM",
|
"DOWNLOAD": "Download SBOM",
|
||||||
"Details": "SBOM details",
|
"Details": "SBOM details",
|
||||||
"STOP": "Stop SBOM",
|
"STOP": "Stop Generate SBOM",
|
||||||
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
|
||||||
},
|
},
|
||||||
"VULNERABILITY": {
|
"VULNERABILITY": {
|
||||||
|
|
|
@ -89,8 +89,11 @@ copy_artifact = Permission("{}/projects/{}/repositories/target_repo/artifacts?fr
|
||||||
delete_artifact = Permission("{}/projects/{}/repositories/target_repo/artifacts/{}".format(harbor_base_url, project_name, source_artifact_tag), "DELETE", 200)
|
delete_artifact = Permission("{}/projects/{}/repositories/target_repo/artifacts/{}".format(harbor_base_url, project_name, source_artifact_tag), "DELETE", 200)
|
||||||
|
|
||||||
# 6. Resource scan actions: ['read', 'create', 'stop']
|
# 6. Resource scan actions: ['read', 'create', 'stop']
|
||||||
|
stop_scan_payload = {
|
||||||
|
"scan_type": "vulnerability"
|
||||||
|
}
|
||||||
create_scan = Permission("{}/projects/{}/repositories/{}/artifacts/{}/scan".format(harbor_base_url, project_name, source_artifact_name, source_artifact_tag), "POST", 202)
|
create_scan = Permission("{}/projects/{}/repositories/{}/artifacts/{}/scan".format(harbor_base_url, project_name, source_artifact_name, source_artifact_tag), "POST", 202)
|
||||||
stop_scan = Permission("{}/projects/{}/repositories/{}/artifacts/{}/scan/stop".format(harbor_base_url, project_name, source_artifact_name, source_artifact_tag), "POST", 202)
|
stop_scan = Permission("{}/projects/{}/repositories/{}/artifacts/{}/scan/stop".format(harbor_base_url, project_name, source_artifact_name, source_artifact_tag), "POST", 202, stop_scan_payload)
|
||||||
read_scan = Permission("{}/projects/{}/repositories/{}/artifacts/{}/scan/83be44fd-1234-5678-b49f-4b6d6e8f5730/log".format(harbor_base_url, project_name, source_artifact_name, source_artifact_tag), "get", 404)
|
read_scan = Permission("{}/projects/{}/repositories/{}/artifacts/{}/scan/83be44fd-1234-5678-b49f-4b6d6e8f5730/log".format(harbor_base_url, project_name, source_artifact_name, source_artifact_tag), "get", 404)
|
||||||
|
|
||||||
# 7. Resource tag actions: ['list', 'create', 'delete']
|
# 7. Resource tag actions: ['list', 'create', 'delete']
|
||||||
|
|
|
@ -24,8 +24,8 @@ Create A Project Robot Account
|
||||||
${permission_count}= Create Dictionary
|
${permission_count}= Create Dictionary
|
||||||
${total}= Set Variable 0
|
${total}= Set Variable 0
|
||||||
IF '${first_resource}' == 'all'
|
IF '${first_resource}' == 'all'
|
||||||
Set To Dictionary ${permission_count} all=56
|
Set To Dictionary ${permission_count} all=59
|
||||||
${total}= Set Variable 56
|
${total}= Set Variable 59
|
||||||
Retry Element Click //span[text()='Select all']
|
Retry Element Click //span[text()='Select all']
|
||||||
ELSE
|
ELSE
|
||||||
FOR ${item} IN @{resources}
|
FOR ${item} IN @{resources}
|
||||||
|
|
|
@ -745,7 +745,7 @@ Test Case - System Robot Account
|
||||||
|
|
||||||
${robot_account_name} ${token}= Create A System Robot Account sys2${d} days days=2 description=For testing cover_all_project_resources=${true}
|
${robot_account_name} ${token}= Create A System Robot Account sys2${d} days days=2 description=For testing cover_all_project_resources=${true}
|
||||||
Push image ${ip} '${robot_account_name}' ${token} project${d} hello-world:latest
|
Push image ${ip} '${robot_account_name}' ${token} project${d} hello-world:latest
|
||||||
Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//span[text()='All projects with'] and .//button[text()=' 56 PERMISSION(S) '] and .//span[contains(.,'1d 23h')] and .//clr-dg-cell[text()='For testing'] and .//clr-dg-cell//span[text()=' None ']]
|
Retry Wait Element Visible //clr-dg-row[.//clr-dg-cell[contains(.,'${robot_account_name}')] and .//clr-icon[contains(@class, 'color-green')] and .//span[text()='All projects with'] and .//button[text()=' 59 PERMISSION(S) '] and .//span[contains(.,'1d 23h')] and .//clr-dg-cell[text()='For testing'] and .//clr-dg-cell//span[text()=' None ']]
|
||||||
Retry Action Keyword Check System Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} all 1
|
Retry Action Keyword Check System Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} all 1
|
||||||
Retry Action Keyword Check Project Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project_id} ${project_name} hello-world latest all
|
Retry Action Keyword Check Project Robot Account API Permission ${robot_account_name} ${token} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} ${project_id} ${project_name} hello-world latest all
|
||||||
Close Browser
|
Close Browser
|
||||||
|
@ -885,13 +885,13 @@ Test Case - Audit Log And Purge
|
||||||
# pull artifact
|
# pull artifact
|
||||||
Docker Pull ${ip}/project${d}/${image}:${tag1}
|
Docker Pull ${ip}/project${d}/${image}:${tag1}
|
||||||
Docker Logout ${ip}
|
Docker Logout ${ip}
|
||||||
Verify Log ${user} project${d}/${image}:${sha256} artifact pull
|
Verify Log ${user} project${d}/${image}@${sha256} artifact pull
|
||||||
Go Into Repo project${d} ${image}
|
Go Into Repo project${d} ${image}
|
||||||
# delete artifact
|
# delete artifact
|
||||||
@{tag_list} Create List ${tag1}
|
@{tag_list} Create List ${tag1}
|
||||||
Multi-delete Artifact @{tag_list}
|
Multi-delete Artifact @{tag_list}
|
||||||
Switch To Logs
|
Switch To Logs
|
||||||
Verify Log ${user} project${d}/${image}:${sha256} artifact delete
|
Verify Log ${user} project${d}/${image}@${sha256} artifact delete
|
||||||
Go Into Project project${d}
|
Go Into Project project${d}
|
||||||
# delete repository
|
# delete repository
|
||||||
Delete Repo project${d} ${image}
|
Delete Repo project${d} ${image}
|
||||||
|
@ -1151,8 +1151,8 @@ Test Case - Retain Image Last Pull Time
|
||||||
Scan Repo ${tag} Succeed
|
Scan Repo ${tag} Succeed
|
||||||
Sleep 15
|
Sleep 15
|
||||||
Reload Page
|
Reload Page
|
||||||
Retry Wait Element Visible //clr-dg-row//clr-dg-cell[9]
|
Retry Wait Element Visible //clr-dg-row//clr-dg-cell[10]
|
||||||
${last_pull_time}= Get Text //clr-dg-row//clr-dg-cell[9]
|
${last_pull_time}= Get Text //clr-dg-row//clr-dg-cell[10]
|
||||||
Should Be Empty ${last_pull_time}
|
Should Be Empty ${last_pull_time}
|
||||||
Switch To Configuration System Setting
|
Switch To Configuration System Setting
|
||||||
Set Up Retain Image Last Pull Time disable
|
Set Up Retain Image Last Pull Time disable
|
||||||
|
@ -1160,8 +1160,8 @@ Test Case - Retain Image Last Pull Time
|
||||||
Scan Repo ${tag} Succeed
|
Scan Repo ${tag} Succeed
|
||||||
Sleep 15
|
Sleep 15
|
||||||
Reload Page
|
Reload Page
|
||||||
Retry Wait Element Visible //clr-dg-row//clr-dg-cell[9]
|
Retry Wait Element Visible //clr-dg-row//clr-dg-cell[10]
|
||||||
${last_pull_time}= Get Text //clr-dg-row//clr-dg-cell[9]
|
${last_pull_time}= Get Text //clr-dg-row//clr-dg-cell[10]
|
||||||
Should Not Be Empty ${last_pull_time}
|
Should Not Be Empty ${last_pull_time}
|
||||||
Close Browser
|
Close Browser
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue