Skip to content

feat: Add Share API endpoints and AES-256-GCM cipher for public links#40

Merged
patricioxavier8 merged 5 commits into
mainfrom
feature/public-link-sharing
May 11, 2026
Merged

feat: Add Share API endpoints and AES-256-GCM cipher for public links#40
patricioxavier8 merged 5 commits into
mainfrom
feature/public-link-sharing

Conversation

@patricioxavier8
Copy link
Copy Markdown
Contributor

This PR introduces the necessary cryptographic tools, API endpoints, and models to support creating Public Share Links

Changes

  1. Cryptography (InternxtAESCipher.swift)

Added a new InternxtAESCipher class using Apple's CryptoKit.
Implements AES-256-GCM with PBKDF2-HMAC-SHA512 (2145 iterations) to exactly match the web client's encryption spec for public shares.
Added a URL-safe random string generator for share codes.
2. API & Models (DriveAPI.swift & DriveTypes.swift)

Models: Added CreateSharingPayload, CreateSharingResponse, and ShareDomainsResponse.
Endpoints: Added createSharing() (POST /sharings/) and getShareDomains() (GET gateway share domains).

@patricioxavier8 patricioxavier8 self-assigned this May 6, 2026
@patricioxavier8 patricioxavier8 requested review from CandelR and sg-gs May 6, 2026 22:20
@CandelR CandelR requested a review from TamaraFinogina May 7, 2026 06:30
Comment thread Sources/InternxtSwiftCore/Services/Crypto/InternxtAESCipher.swift
Comment thread Sources/InternxtSwiftCore/Services/Crypto/InternxtAESCipher.swift Outdated
- Validate the OSStatus return of `SecRandomCopyBytes` with a guard statement to avoid using uninitialized/zero-filled byte arrays if CSPRNG fails.
- Propagate errors by making `generateRandomUrlSafeString` throwing (`throws`).
@patricioxavier8 patricioxavier8 merged commit ed16b84 into main May 11, 2026
1 check passed
@patricioxavier8 patricioxavier8 deleted the feature/public-link-sharing branch May 11, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants