Merge pull request #34258 from backstage/freben/mock-credentials-version

backend-test-utils: add version field to mock credentials
This commit is contained in:
Fredrik Adelöw
2026-05-19 09:24:41 +02:00
committed by GitHub
5 changed files with 70 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
Fixed `mockCredentials` to include the internal `version: 'v1'` field on all credential objects (`none()`, `user()`, `limitedUser()`, `service()`), and fixed `user()` to encode the user entity ref into the token (matching `user.token(ref)` behavior). This makes mock credentials compatible with `toInternalBackstageCredentials()`, which validates the version field, and ensures that credentials for different users produce different tokens.