This commit is contained in:
2025-08-22 19:53:42 -04:00
parent c85812ddb6
commit 738499037f
4 changed files with 191 additions and 14 deletions

View File

@ -420,12 +420,15 @@ func (suite *IntegrationTestSuite) TestStaticTokenWorkflow() {
assert.True(t, verifyResp.Valid)
assert.Equal(t, domain.TokenTypeStatic, verifyResp.TokenType)
// Note: The current service implementation returns ["basic"] as a placeholder
assert.Contains(t, verifyResp.Permissions, "basic")
// Verify that we get the actual permissions that were granted to the token
assert.Contains(t, verifyResp.Permissions, "repo.read")
assert.Contains(t, verifyResp.Permissions, "repo.write")
if verifyResp.PermissionResults != nil {
// Check that we get some permission results
// Check that we get permission results for the requested permissions
assert.NotEmpty(t, verifyResp.PermissionResults)
// The token should have the "repo.read" permission we requested
assert.True(t, verifyResp.PermissionResults["repo.read"])
}
})
}