-
This commit is contained in:
@ -267,10 +267,12 @@ test_token_endpoints() {
|
||||
-H "X-User-Email: $USER_EMAIL" \
|
||||
-H "X-User-ID: $USER_ID" \
|
||||
-d '{
|
||||
"name": "Test Static Token for Deletion",
|
||||
"description": "A test static token for deletion test",
|
||||
"permissions": ["read"],
|
||||
"expires_at": "2025-12-31T23:59:59Z"
|
||||
"owner": {
|
||||
"type": "individual",
|
||||
"name": "Test Token Owner",
|
||||
"owner": "test-token@example.com"
|
||||
},
|
||||
"permissions": ["repo.read", "repo.write"]
|
||||
}' 2>/dev/null || echo -e "\n000")
|
||||
|
||||
local token_status_code=$(echo "$token_response" | tail -n1)
|
||||
@ -282,10 +284,12 @@ test_token_endpoints() {
|
||||
-H "X-User-Email: $USER_EMAIL" \
|
||||
-H "X-User-ID: $USER_ID" \
|
||||
-d '{
|
||||
"name": "Test Static Token",
|
||||
"description": "A test static token",
|
||||
"permissions": ["read"],
|
||||
"expires_at": "2025-12-31T23:59:59Z"
|
||||
"owner": {
|
||||
"type": "individual",
|
||||
"name": "Test Token Owner",
|
||||
"owner": "test-token@example.com"
|
||||
},
|
||||
"permissions": ["repo.read", "repo.write"]
|
||||
}'
|
||||
|
||||
# Extract token_id from the first response for deletion test
|
||||
|
||||
@ -96,7 +96,7 @@ func (suite *IntegrationTestSuite) setupServer() {
|
||||
|
||||
// Initialize services
|
||||
appService := services.NewApplicationService(appRepo, logger)
|
||||
tokenService := services.NewTokenService(tokenRepo, appRepo, permRepo, grantRepo, logger)
|
||||
tokenService := services.NewTokenService(tokenRepo, appRepo, permRepo, grantRepo, suite.cfg.GetString("INTERNAL_HMAC_KEY"), logger)
|
||||
authService := services.NewAuthenticationService(suite.cfg, logger)
|
||||
|
||||
// Initialize handlers
|
||||
|
||||
@ -460,14 +460,14 @@ func (m *MockPermissionRepository) ValidatePermissionScopes(ctx context.Context,
|
||||
m.mu.RLock()
|
||||
defer m.mu.RUnlock()
|
||||
|
||||
var invalid []string
|
||||
var valid []string
|
||||
for _, scope := range scopes {
|
||||
if _, exists := m.scopeIndex[scope]; !exists {
|
||||
invalid = append(invalid, scope)
|
||||
if _, exists := m.scopeIndex[scope]; exists {
|
||||
valid = append(valid, scope)
|
||||
}
|
||||
}
|
||||
|
||||
return invalid, nil
|
||||
return valid, nil
|
||||
}
|
||||
|
||||
func (m *MockPermissionRepository) GetPermissionHierarchy(ctx context.Context, scopes []string) ([]*domain.AvailablePermission, error) {
|
||||
|
||||
Reference in New Issue
Block a user