mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-07 00:17:51 +01:00
e324a4d623
- add DAO layer for scanner registration - add CURD manager for scanner registration - add API controller for plug scanner - add REST APIs for CURD of plug scanner - add migration sql:0011_1.10.0 - add scan interface definition (no implementations) - add related UT cases with testify fix #8979 #8990 Signed-off-by: Steven Zou <szou@vmware.com>
35 lines
1.1 KiB
SQL
35 lines
1.1 KiB
SQL
/*Table for keeping the plug scanner registration*/
|
|
CREATE TABLE scanner_registration
|
|
(
|
|
id SERIAL PRIMARY KEY NOT NULL,
|
|
uuid VARCHAR(64) UNIQUE NOT NULL,
|
|
url VARCHAR(256) UNIQUE NOT NULL,
|
|
name VARCHAR(128) UNIQUE NOT NULL,
|
|
description VARCHAR(1024) NULL,
|
|
auth VARCHAR(16) NOT NULL,
|
|
access_cred VARCHAR(512) NULL,
|
|
adapter VARCHAR(128) NOT NULL,
|
|
vendor VARCHAR(128) NOT NULL,
|
|
version VARCHAR(32) NOT NULL,
|
|
disabled BOOLEAN NOT NULL DEFAULT FALSE,
|
|
is_default BOOLEAN NOT NULL DEFAULT FALSE,
|
|
skip_cert_verify BOOLEAN NOT NULL DEFAULT FALSE,
|
|
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
/*Table for keeping the scanner report. The report details are stored as JSONB*/
|
|
CREATE TABLE scanner_report
|
|
(
|
|
id SERIAL PRIMARY KEY NOT NULL,
|
|
digest VARCHAR(256) NOT NULL,
|
|
registration_id VARCHAR(64) NOT NULL,
|
|
job_id VARCHAR(32),
|
|
status VARCHAR(16) NOT NULL,
|
|
status_code INTEGER DEFAULT 0,
|
|
report JSON,
|
|
start_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
end_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
UNIQUE(digest, registration_id)
|
|
)
|