feat(oci): Support configurable OCI token realm/service and centralize unauthorized responses

This commit is contained in:
2025-11-25 16:48:08 +00:00
parent 9b92e1c0d2
commit 3b5bf5e789
4 changed files with 30 additions and 19 deletions

View File

@@ -42,7 +42,11 @@ export class SmartRegistry {
// Initialize OCI registry if enabled
if (this.config.oci?.enabled) {
const ociBasePath = this.config.oci.basePath ?? '/oci';
const ociRegistry = new OciRegistry(this.storage, this.authManager, ociBasePath);
const ociTokens = this.config.auth.ociTokens?.enabled ? {
realm: this.config.auth.ociTokens.realm,
service: this.config.auth.ociTokens.service,
} : undefined;
const ociRegistry = new OciRegistry(this.storage, this.authManager, ociBasePath, ociTokens);
await ociRegistry.init();
this.registries.set('oci', ociRegistry);
}