Skip to content

Commit

Permalink
Merge pull request #1159 from O-sura/main
Browse files Browse the repository at this point in the history
Adding oAuth2 disabled configuration to APK-Conf
  • Loading branch information
CrowleyRajapakse authored Apr 26, 2024
2 parents a4b769c + 490c351 commit f91e206
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apim-apk-agent/pkg/transformer/apk_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type AuthConfiguration struct {
AuthType string `yaml:"authType,omitempty"`
HeaderName string `yaml:"headerName,omitempty"`
SendTokenUpStream bool `yaml:"sendTokenToUpstream,omitempty"`
Enabled bool `yaml:"enabled,omitempty"`
Enabled bool `yaml:"enabled"`
QueryParamName string `yaml:"queryParamName,omitempty"`
HeaderEnabled bool `yaml:"headerEnable,omitempty"`
queryParamEnable bool `yaml:"queryParamEnable,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions apim-apk-agent/pkg/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@ func mapAuthConfigs(apiUUID string, authHeader string, secSchemes []string, cert

authConfigs = append(authConfigs, newConfig)
}
if !StringExists("oauth2", secSchemes) {
oAuth2DisabledConfig := AuthConfiguration{
AuthType: oAuth2,
Enabled: false,
}
authConfigs = append(authConfigs, oAuth2DisabledConfig)
}
if StringExists("mutualssl", secSchemes) && certAvailable {
var newConfig AuthConfiguration
newConfig.AuthType = mTLS
Expand Down

0 comments on commit f91e206

Please sign in to comment.