[GH-ISSUE #193] Add App Encryption Declarations (export compliance) CLI support #57

Closed
opened 2026-02-26 21:33:03 +03:00 by kerem · 1 comment
Owner

Originally created by @rudrankriyam on GitHub (Jan 26, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/193

Overview

Add CLI support for App Encryption Declarations (export compliance). This is required when usesNonExemptEncryption=true and blocks App Review without a declaration.

Docs (API)

Scope (Endpoints)

Read/list:

  • GET /v1/appEncryptionDeclarations
  • GET /v1/appEncryptionDeclarations/{id}
  • GET /v1/apps/{id}/appEncryptionDeclarations
  • GET /v1/apps/{id}/relationships/appEncryptionDeclarations
  • GET /v1/appEncryptionDeclarations/{id}/appEncryptionDeclarationDocument
  • GET /v1/appEncryptionDeclarationDocuments/{id}

Create/update:

  • POST /v1/appEncryptionDeclarations
  • POST /v1/appEncryptionDeclarations/{id}/relationships/builds
  • POST /v1/appEncryptionDeclarationDocuments
  • PATCH /v1/appEncryptionDeclarationDocuments/{id} (commit)

Proposed CLI

Top-level group (suggested): asc encryption <subcommand> [flags]

Subcommands:

  • encryption declarations list --app APP_ID
  • encryption declarations get --id DECL_ID
  • encryption declarations create --app APP_ID [attributes per OpenAPI]
  • encryption declarations assign-builds --id DECL_ID --build BUILD_ID[,BUILD_ID...]
  • encryption documents get --id DOC_ID
  • encryption documents upload --declaration DECL_ID --file ./export.pdf (create + upload ops + commit)

Required Attributes

⚠️ Use the OpenAPI spec to surface required/optional fields for creation.
Search the spec for:

  • AppEncryptionDeclarationCreateRequest
  • AppEncryptionDeclarationCreateRequest.Data.Attributes
  • AppEncryptionDeclarationDocumentCreateRequest

Expose those fields via explicit CLI flags and validate required combinations.

Output

  • JSON (minified) by default
  • Table/markdown for list/get
  • Upload result should include declaration ID, document ID, file name, state

Acceptance Criteria

  • asc encryption --help is available
  • Can list/get declarations for an app
  • Can create a declaration (fields validated against OpenAPI)
  • Can upload and commit a declaration document
  • Can assign builds to a declaration
  • JSON/table/markdown output

Tests

  • CLI validation tests for required fields and invalid combinations
  • HTTP client tests for list/get/create/assign builds
  • Upload tests with mocked presigned URLs (SSRF-safe validation)
  • Output tests for table/markdown

Manual Test Plan (using real apps)

  1. Find IDs:
    • asc apps --paginateAPP_ID
    • asc builds list --app APP_ID --paginateBUILD_ID (pick a build with usesNonExemptEncryption=true if applicable)
  2. List declarations:
    • asc encryption declarations list --app APP_ID
  3. Create declaration (example flags must match OpenAPI fields):
    • asc encryption declarations create --app APP_ID [required flags]
  4. Upload document:
    • asc encryption documents upload --declaration DECL_ID --file ./export.pdf
  5. Assign build:
    • asc encryption declarations assign-builds --id DECL_ID --build BUILD_ID
  6. Get declaration + document:
    • asc encryption declarations get --id DECL_ID
    • asc encryption documents get --id DOC_ID

Implementation Notes

  • Add cmd/encryption.go (group + subcommands)
  • Add internal/asc/encryption.go + output helpers
  • Reuse upload helper patterns from assets/builds for document uploads
  • Register command in cmd/root.go
Originally created by @rudrankriyam on GitHub (Jan 26, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/193 # Overview Add CLI support for **App Encryption Declarations** (export compliance). This is required when `usesNonExemptEncryption=true` and blocks App Review without a declaration. # Docs (API) - App Encryption Declarations: https://sosumi.ai/documentation/appstoreconnectapi/app-encryption-declarations - Create request object: https://sosumi.ai/documentation/appstoreconnectapi/appencryptiondeclarationcreaterequest - OpenAPI spec (fields): https://raw.githubusercontent.com/EvanBacon/App-Store-Connect-OpenAPI-Spec/main/specs/latest.json # Scope (Endpoints) Read/list: - `GET /v1/appEncryptionDeclarations` - `GET /v1/appEncryptionDeclarations/{id}` - `GET /v1/apps/{id}/appEncryptionDeclarations` - `GET /v1/apps/{id}/relationships/appEncryptionDeclarations` - `GET /v1/appEncryptionDeclarations/{id}/appEncryptionDeclarationDocument` - `GET /v1/appEncryptionDeclarationDocuments/{id}` Create/update: - `POST /v1/appEncryptionDeclarations` - `POST /v1/appEncryptionDeclarations/{id}/relationships/builds` - `POST /v1/appEncryptionDeclarationDocuments` - `PATCH /v1/appEncryptionDeclarationDocuments/{id}` (commit) # Proposed CLI Top-level group (suggested): `asc encryption <subcommand> [flags]` Subcommands: - `encryption declarations list --app APP_ID` - `encryption declarations get --id DECL_ID` - `encryption declarations create --app APP_ID [attributes per OpenAPI]` - `encryption declarations assign-builds --id DECL_ID --build BUILD_ID[,BUILD_ID...]` - `encryption documents get --id DOC_ID` - `encryption documents upload --declaration DECL_ID --file ./export.pdf` (create + upload ops + commit) # Required Attributes ⚠️ Use the OpenAPI spec to surface required/optional fields for creation. Search the spec for: - `AppEncryptionDeclarationCreateRequest` - `AppEncryptionDeclarationCreateRequest.Data.Attributes` - `AppEncryptionDeclarationDocumentCreateRequest` Expose those fields via explicit CLI flags and validate required combinations. # Output - JSON (minified) by default - Table/markdown for list/get - Upload result should include declaration ID, document ID, file name, state # Acceptance Criteria - [ ] `asc encryption --help` is available - [ ] Can list/get declarations for an app - [ ] Can create a declaration (fields validated against OpenAPI) - [ ] Can upload and commit a declaration document - [ ] Can assign builds to a declaration - [ ] JSON/table/markdown output # Tests - CLI validation tests for required fields and invalid combinations - HTTP client tests for list/get/create/assign builds - Upload tests with mocked presigned URLs (SSRF-safe validation) - Output tests for table/markdown # Manual Test Plan (using real apps) 1) Find IDs: - `asc apps --paginate` → `APP_ID` - `asc builds list --app APP_ID --paginate` → `BUILD_ID` (pick a build with `usesNonExemptEncryption=true` if applicable) 2) List declarations: - `asc encryption declarations list --app APP_ID` 3) Create declaration (example flags must match OpenAPI fields): - `asc encryption declarations create --app APP_ID [required flags]` 4) Upload document: - `asc encryption documents upload --declaration DECL_ID --file ./export.pdf` 5) Assign build: - `asc encryption declarations assign-builds --id DECL_ID --build BUILD_ID` 6) Get declaration + document: - `asc encryption declarations get --id DECL_ID` - `asc encryption documents get --id DOC_ID` # Implementation Notes - Add `cmd/encryption.go` (group + subcommands) - Add `internal/asc/encryption.go` + output helpers - Reuse upload helper patterns from assets/builds for document uploads - Register command in `cmd/root.go`
kerem closed this issue 2026-02-26 21:33:04 +03:00
Author
Owner
<!-- gh-comment-id:3808155586 --> @rudrankriyam commented on GitHub (Jan 27, 2026): Closed as fixed by #234, #239. PRs: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/234, https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/239
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#57
No description provided.