Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message for SCS and Enterprise Secret (AST-73370) #1007

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arturfalcao
Copy link
Collaborator

Description
This PR addresses the issue of handling feature flags and allowed engines in the JWTMockWrapper and JWTStruct implementations. It includes the following changes:
Added a new mock for GetAllowedEngines to work with different engines set in tests.

Updated the GetAllowedEngines method in JWTStruct to handle feature flags and return the correct allowed engines.
Added unit tests to validate the behavior of the new mock and the updated GetAllowedEngines method.

References
Include supporting link to GitHub Issue/PR number

Testing
This change was tested by adding unit tests for the GetAllowedEngines method and the new mock implementation. The tests cover various scenarios to ensure the correct engines are returned based on the feature flags and JWT token data. All existing tests were run to ensure no regressions were introduced.

@github-actions github-actions bot added the bug Something isn't working label Jan 14, 2025
@arturfalcao arturfalcao self-assigned this Jan 14, 2025
Copy link

github-actions bot commented Jan 14, 2025

Logo
Checkmarx One – Scan Summary & Detailsb7409d4a-69bf-443f-8f97-6b82af1738dd

Great job, no security vulnerabilities found in this Pull Request

@@ -7,13 +7,17 @@ import (
)

type JWTMockWrapper struct {
AIEnabled int
AIEnabled int
CustomGetAllowedEngines func(wrappers.FeatureFlagsWrapper) (map[string]bool, error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea

@arturfalcao arturfalcao enabled auto-merge January 16, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants