Skip to content

feat: choose whether an uploaded build goes into use, and document application access tokens - #23

Merged
burnedikt merged 5 commits into
mainfrom
docs/application-access-tokens
Nov 23, 2026
Merged

burnedikt merged 5 commits into
mainfrom
docs/application-access-tokens

Conversation

@burnedikt

@burnedikt burnedikt commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Update: choose whether an uploaded build goes into use (feat)

applications v2 upload-build gets --set-as-current-version / --no-set-as-current-version:

  • --set-as-current-version puts the build into use. Launch configurations of its XR platforms without a build get it right away, and the others switch to it once Portal has scanned and validated it. With an application access token, this needs "Publish builds".
  • --no-set-as-current-version saves the build without putting it into use.
  • Neither: nothing is sent and Portal decides. Builds uploaded with an access token aren't put into use (Innoactive/Portal-Backend#2734), and builds uploaded by people are, as before.

Before this, a token with upload and publish put every upload into use, because the CLI never sent the field and Portal's default is true. The README's pipeline example now uploads with --set-as-current-version, and update-launch-configuration is described as the way to publish later, for example after a test stage. Tests: tests/test_applications_v2_upload_build.py (3 new; 66 pass).

Also on this branch: chore syncs uv.lock with the 3.6.0 project version. The 3.6.0 release commit bumped only pyproject.toml, so uv sync --locked has failed CI on main since 2026-10-06. #22 already makes later releases update both.

Verified end to end against Innoactive/Portal-Backend#2734 on a local stack:

Token Command Result
upload + publish upload-build, no flag build stored and validated; launch configuration unchanged
upload + publish upload-build --set-as-current-version launch configuration switched to it once it was validated
upload only upload-build --set-as-current-version 400 "Putting a build into use needs an access token with publish."

What changed (first version)

  • Authentication → Application access tokens for CI/CD pipelines and integrations (new subsection). It covers:
    • Portal's application access tokens (ipat_…, Innoactive/Portal-Backend#2232) as the credential for pipelines and integrations.
    • A table of the three permissions (Upload, Publish and Download builds) and the command that needs each.
    • What every token can read, and that it can't do anything else.
    • Where to create, revoke and rotate a token (the application's Access Control → Access Tokens), and that the secret is shown once.
    • That no organization needs to be named, and what 401 and 403 mean.
    • A note that Portal refuses passwords for accounts that use or require two-factor authentication.
  • Examples → Uploading and publishing from a CI/CD pipeline:
    • upload-build followed by update-launch-configuration.
    • What the upload does with an upload-only token compared with an upload + publish token.
    • A GitHub Actions step.
  • Examples → Downloading a build: builds download, and the Authorization: Bearer header for other tools.
  • Separate commit: the existing upload example had # comments after each \, which broke it when pasted into a shell. The command is now copy-pasteable, and the options are explained below it.

The CLI already sends PORTAL_BACKEND_ACCESS_TOKEN as Authorization: Bearer …, and none of these commands sends an organization.

How it was verified

Setup:

  • Portal-Backend develop at a7120bfc3 (the merge of Innoactive/Portal-Backend#2724), served by runserver on the host with SQLite. Docker's Postgres wouldn't start on the machine, so scripts/dev-stack wasn't used.
  • This branch's CLI (3.6.0), with PORTAL_BACKEND_ENDPOINT=http://localhost:8399 and an empty config directory, so no stored login was used.
  • Three tokens created through POST /api/v2/applications/<id>/access-tokens/ as an application manager: upload + publish, upload only, and download only.

Results, all with the commands as the README shows them:

Token Command Result
upload + publish applications v2 upload-build ./build.zip --application-id … --version … --xr-platform win-non-vr --executable-path MyApp.exe 201; the build names the token in uploaded_by_token
upload + publish a second upload of a valid build the launch configuration moved to it once it validated
upload + publish applications v2 update-launch-configuration <app> win-non-vr <build>, and with quest 200
upload + publish applications v2 get <app>, applications v2 builds get <build> 200
upload + publish the GitHub Actions run: block under bash -eo pipefail succeeds
upload + publish the fixed upload example (launch args and changelog) stored as given
upload only upload-build (quest) 201; the launch configuration kept its build
upload only update-launch-configuration 403
upload only upload-build --xr-platform pico (no such launch configuration) 400: "Adding a launch configuration needs an access token with publish." The Actions block fails the step on it
upload only builds download 403
download builds download <build> --filepath ./downloaded.apk byte-identical to the uploaded APK
download builds download without --filepath the temp-dir path is printed
download curl of application_archive with Authorization: Bearer … 200, identical
download upload-build 403
download applications v2 list 403 (tokens can only get their application, as the README says)
download Portal-Organization-Id naming the token's organization / another organization 200 / 403
revoked (DELETE …/access-tokens/<id>/ → 204) builds download 401, "The access token is invalid, expired or revoked."

The secret doesn't appear in the server log.

Part of Innoactive/Portal-Backend#2721.

🤖 Generated with Claude Code

burnedikt and others added 5 commits November 19, 2026 23:14
Document Portal's application access tokens (`ipat_…`) as the credential for pipelines
and integrations: what each permission allows and which command needs it, where to create
and revoke a token, that it acts in its own organization, and the 401/403 answers. Add
examples for uploading and publishing from a pipeline (with a GitHub Actions step) and for
downloading a build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comments after each line continuation broke the command when pasted into a shell. The
command now runs as is, and the options are explained below it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 3.6.0 release commit bumped pyproject.toml only, so `uv sync --locked`
in CI rejects the lockfile, which still records portal-client 3.5.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`applications v2 upload-build --set-as-current-version` puts the build into use: launch
configurations of its XR platforms without a build get it right away, and the others switch
to it once Portal has scanned and validated it. `--no-set-as-current-version` saves it
without putting it into use. Without either, Portal decides: builds uploaded with an
application access token are not put into use, builds uploaded by people are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@burnedikt burnedikt changed the title docs(readme): use application access tokens in CI/CD pipelines feat: choose whether an uploaded build goes into use, and document application access tokens Nov 20, 2026
@burnedikt
burnedikt marked this pull request as ready for review November 23, 2026 12:41
@burnedikt
burnedikt merged commit 1befa73 into main Nov 23, 2026
2 checks passed
@burnedikt
burnedikt deleted the docs/application-access-tokens branch November 23, 2026 12:42
@innoactive-semantic-release

Copy link
Copy Markdown

🎉 This PR is included in version 3.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant