feat(external-registry): Implement CRUD operations and connection verification for external registries
This commit is contained in:
@@ -3,10 +3,108 @@ import * as plugins from '../plugins.js';
|
||||
export interface IExternalRegistry {
|
||||
id: string;
|
||||
data: {
|
||||
/**
|
||||
* Registry type
|
||||
*/
|
||||
type: 'docker' | 'npm';
|
||||
|
||||
/**
|
||||
* Human-readable name for the registry
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Registry URL (e.g., https://registry.gitlab.com, docker.io)
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Username for authentication
|
||||
*/
|
||||
username: string;
|
||||
|
||||
/**
|
||||
* Password or access token for authentication
|
||||
*/
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* Optional description
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Whether this is the default registry for its type
|
||||
*/
|
||||
isDefault?: boolean;
|
||||
|
||||
/**
|
||||
* Authentication type
|
||||
*/
|
||||
authType?: 'basic' | 'token' | 'oauth2';
|
||||
|
||||
/**
|
||||
* Allow insecure registry connections (HTTP or self-signed certs)
|
||||
*/
|
||||
insecure?: boolean;
|
||||
|
||||
/**
|
||||
* Optional namespace/organization for the registry
|
||||
*/
|
||||
namespace?: string;
|
||||
|
||||
/**
|
||||
* Proxy configuration
|
||||
*/
|
||||
proxy?: {
|
||||
http?: string;
|
||||
https?: string;
|
||||
noProxy?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Registry-specific configuration
|
||||
*/
|
||||
config?: {
|
||||
/**
|
||||
* For Docker registries
|
||||
*/
|
||||
dockerConfig?: {
|
||||
email?: string;
|
||||
serverAddress?: string;
|
||||
};
|
||||
/**
|
||||
* For npm registries
|
||||
*/
|
||||
npmConfig?: {
|
||||
scope?: string;
|
||||
alwaysAuth?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Status of the registry connection
|
||||
*/
|
||||
status?: 'active' | 'inactive' | 'error' | 'unverified';
|
||||
|
||||
/**
|
||||
* Last error message if status is 'error'
|
||||
*/
|
||||
lastError?: string;
|
||||
|
||||
/**
|
||||
* Timestamp when the registry was last successfully verified
|
||||
*/
|
||||
lastVerified?: number;
|
||||
|
||||
/**
|
||||
* Timestamp when the registry was created
|
||||
*/
|
||||
createdAt?: number;
|
||||
|
||||
/**
|
||||
* Timestamp when the registry was last updated
|
||||
*/
|
||||
updatedAt?: number;
|
||||
};
|
||||
}
|
@@ -50,6 +50,7 @@ export interface IReq_UpdateRegistry extends plugins.typedrequestInterfaces.impl
|
||||
method: 'updateExternalRegistry';
|
||||
request: {
|
||||
identity: userInterfaces.IIdentity;
|
||||
registryId: string;
|
||||
registryData: data.IExternalRegistry['data'];
|
||||
};
|
||||
response: {
|
||||
@@ -69,4 +70,20 @@ export interface IReq_DeleteRegistryById extends plugins.typedrequestInterfaces.
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_VerifyRegistry extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_VerifyRegistry
|
||||
> {
|
||||
method: 'verifyExternalRegistry';
|
||||
request: {
|
||||
identity: userInterfaces.IIdentity;
|
||||
registryId: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
message?: string;
|
||||
registry?: data.IExternalRegistry;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user