2 Commits

Author SHA1 Message Date
4f662ff611 v1.7.0
Some checks failed
Default (tags) / security (push) Successful in 40s
Default (tags) / test (push) Failing after 36s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-23 23:54:42 +00:00
b3da95e6c1 feat(core): Standardize S3 storage config using @tsclass/tsclass IS3Descriptor and wire it into RegistryStorage and plugins exports; update README and package dependencies. 2025-11-23 23:54:41 +00:00
8 changed files with 39 additions and 21 deletions

View File

@@ -1,5 +1,14 @@
# Changelog # Changelog
## 2025-11-23 - 1.7.0 - feat(core)
Standardize S3 storage config using @tsclass/tsclass IS3Descriptor and wire it into RegistryStorage and plugins exports; update README and package dependencies.
- Add @tsclass/tsclass dependency to package.json to provide a standardized IS3Descriptor for S3 configuration.
- Export tsclass from ts/plugins.ts so plugin types are available to core modules.
- Update IStorageConfig to extend plugins.tsclass.storage.IS3Descriptor, consolidating storage configuration typing.
- Change RegistryStorage.init() to pass the storage config directly as an IS3Descriptor to SmartBucket (bucketName remains part of IStorageConfig).
- Update README storage section with example config and mention IS3Descriptor integration.
## 2025-11-21 - 1.6.0 - feat(core) ## 2025-11-21 - 1.6.0 - feat(core)
Add PyPI and RubyGems registries, integrate into SmartRegistry, extend storage and auth Add PyPI and RubyGems registries, integrate into SmartRegistry, extend storage and auth

View File

@@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartregistry", "name": "@push.rocks/smartregistry",
"version": "1.6.0", "version": "1.7.0",
"private": false, "private": false,
"description": "A composable TypeScript library implementing OCI, NPM, Maven, Cargo, Composer, PyPI, and RubyGems registries for building unified container and package registries", "description": "A composable TypeScript library implementing OCI, NPM, Maven, Cargo, Composer, PyPI, and RubyGems registries for building unified container and package registries",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@@ -48,6 +48,7 @@
"@push.rocks/smartbucket": "^4.3.0", "@push.rocks/smartbucket": "^4.3.0",
"@push.rocks/smartlog": "^3.1.10", "@push.rocks/smartlog": "^3.1.10",
"@push.rocks/smartpath": "^6.0.0", "@push.rocks/smartpath": "^6.0.0",
"@tsclass/tsclass": "^9.3.0",
"adm-zip": "^0.5.10" "adm-zip": "^0.5.10"
}, },
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34" "packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34"

3
pnpm-lock.yaml generated
View File

@@ -20,6 +20,9 @@ importers:
'@push.rocks/smartpath': '@push.rocks/smartpath':
specifier: ^6.0.0 specifier: ^6.0.0
version: 6.0.0 version: 6.0.0
'@tsclass/tsclass':
specifier: ^9.3.0
version: 9.3.0
adm-zip: adm-zip:
specifier: ^0.5.10 specifier: ^0.5.10
version: 0.5.16 version: 0.5.16

View File

@@ -19,7 +19,7 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
### 🏗️ Unified Architecture ### 🏗️ Unified Architecture
- **Composable Design**: Core infrastructure with protocol plugins - **Composable Design**: Core infrastructure with protocol plugins
- **Shared Storage**: Cloud-agnostic S3-compatible backend ([@push.rocks/smartbucket](https://www.npmjs.com/package/@push.rocks/smartbucket)) - **Shared Storage**: Cloud-agnostic S3-compatible backend using [@push.rocks/smartbucket](https://www.npmjs.com/package/@push.rocks/smartbucket) with standardized `IS3Descriptor` from [@tsclass/tsclass](https://www.npmjs.com/package/@tsclass/tsclass)
- **Unified Authentication**: Scope-based permissions across all protocols - **Unified Authentication**: Scope-based permissions across all protocols
- **Path-based Routing**: `/oci/*` for containers, `/npm/*` for packages, `/maven/*` for Java artifacts, `/cargo/*` for Rust crates, `/composer/*` for PHP packages, `/pypi/*` for Python packages, `/rubygems/*` for Ruby gems - **Path-based Routing**: `/oci/*` for containers, `/npm/*` for packages, `/maven/*` for Java artifacts, `/cargo/*` for Rust crates, `/composer/*` for PHP packages, `/pypi/*` for Python packages, `/rubygems/*` for Ruby gems
@@ -652,15 +652,24 @@ const canWrite = await authManager.authorize(
### Storage Configuration ### Storage Configuration
The storage configuration extends `IS3Descriptor` from `@tsclass/tsclass` for standardized S3 configuration:
```typescript ```typescript
import type { IS3Descriptor } from '@tsclass/tsclass';
storage: IS3Descriptor & {
bucketName: string; // Bucket name for registry storage
}
// Example:
storage: { storage: {
accessKey: string; // S3 access key accessKey: string; // S3 access key
accessSecret: string; // S3 secret key accessSecret: string; // S3 secret key
endpoint: string; // S3 endpoint endpoint: string; // S3 endpoint (e.g., 's3.amazonaws.com')
port?: number; // Default: 443 port?: number; // Default: 443
useSsl?: boolean; // Default: true useSsl?: boolean; // Default: true
region?: string; // Default: 'us-east-1' region?: string; // AWS region (e.g., 'us-east-1')
bucketName: string; // Bucket name bucketName: string; // Bucket name for this registry
} }
``` ```

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartregistry', name: '@push.rocks/smartregistry',
version: '1.6.0', version: '1.7.0',
description: 'A composable TypeScript library implementing OCI, NPM, Maven, Cargo, Composer, PyPI, and RubyGems registries for building unified container and package registries' description: 'A composable TypeScript library implementing OCI, NPM, Maven, Cargo, Composer, PyPI, and RubyGems registries for building unified container and package registries'
} }

View File

@@ -18,14 +18,8 @@ export class RegistryStorage implements IStorageBackend {
* Initialize the storage backend * Initialize the storage backend
*/ */
public async init(): Promise<void> { public async init(): Promise<void> {
this.smartBucket = new plugins.smartbucket.SmartBucket({ // Pass config as IS3Descriptor to SmartBucket (bucketName is extra, SmartBucket ignores it)
accessKey: this.config.accessKey, this.smartBucket = new plugins.smartbucket.SmartBucket(this.config as plugins.tsclass.storage.IS3Descriptor);
accessSecret: this.config.accessSecret,
endpoint: this.config.endpoint,
port: this.config.port || 443,
useSsl: this.config.useSsl !== false,
region: this.config.region || 'us-east-1',
});
// Ensure bucket exists // Ensure bucket exists
await this.smartBucket.createBucket(this.bucketName).catch(() => { await this.smartBucket.createBucket(this.bucketName).catch(() => {

View File

@@ -2,6 +2,8 @@
* Core interfaces for the composable registry system * Core interfaces for the composable registry system
*/ */
import type * as plugins from '../plugins.js';
/** /**
* Registry protocol types * Registry protocol types
*/ */
@@ -40,14 +42,9 @@ export interface ICredentials {
/** /**
* Storage backend configuration * Storage backend configuration
* Extends IS3Descriptor from @tsclass/tsclass with bucketName
*/ */
export interface IStorageConfig { export interface IStorageConfig extends plugins.tsclass.storage.IS3Descriptor {
accessKey: string;
accessSecret: string;
endpoint: string;
port?: number;
useSsl?: boolean;
region?: string;
bucketName: string; bucketName: string;
} }

View File

@@ -9,3 +9,8 @@ import * as smartlog from '@push.rocks/smartlog';
import * as smartpath from '@push.rocks/smartpath'; import * as smartpath from '@push.rocks/smartpath';
export { smartbucket, smartlog, smartpath }; export { smartbucket, smartlog, smartpath };
// @tsclass scope
import * as tsclass from '@tsclass/tsclass';
export { tsclass };