Skip to content

Add encrypted GitLab token linking for iPraktikum sync - #16

Merged
nk-coding merged 2 commits into
mainfrom
feat/ipraktikum-issue-sync
Oct 19, 2026
Merged

nk-coding merged 2 commits into
mainfrom
feat/ipraktikum-issue-sync

Conversation

@spethso

@spethso spethso commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

What changes

Add the gitlab-token strategy so a Gropius account can link a GitLab account and supply credentials to the iPraktikum sync worker through the existing internal token API.

  • Verify tokens against the configured GitLab instance and match accounts by stable numeric GitLab user ID, independent of username changes.
  • Store PATs encrypted with AES-256-GCM using GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY; censored strategy configuration does not disclose credentials.
  • Allow token rotation only for the same GitLab identity.
  • Reject unavailable instances, malformed responses, invalid tokens, and cross-account rotations without replacing the stored credential.

The implementation follows the existing strategy registration, account linking, and update-action interfaces. No database migration is required.

Validation

  • npm run build: passed.
  • node --test test/gitlab-token.test.mjs: 3 tests passed, covering encryption/tampering, identity linking/rotation, and validation failures preserving the existing credential.
  • ESLint on the new strategy files with --max-warnings 0: passed.
  • Prettier and git diff --check: passed.
  • Linked the local GitLab account in the end-to-end test environment and used it for synchronization.

Deployment

Set a persistent base64-encoded 32-byte GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY and back it up with the login data. This supports the companion backend adapter; the deployment overlay supplies the encryption-key environment variable.

Related PRs

Backend adapter · Deployment and merge order

@spethso
spethso requested a review from nk-coding October 18, 2026 15:54
@nk-coding
nk-coding merged commit e322acf into main Oct 19, 2026
2 checks passed
@nk-coding
nk-coding deleted the feat/ipraktikum-issue-sync branch October 19, 2026 19:25
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.

2 participants