mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-09-30 03:31:27 +02:00
introduce mapstructure decoder for yaml parsing
remove color output in tests for better readability in github actions bugfix: remove google as default provider for alpha options fix conversion flow for toml to yaml revert ginkgo color deactivation revert claim- and secret source back to pointers regenerate alpha config Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
@@ -9,12 +9,12 @@ import (
|
||||
)
|
||||
|
||||
var _ = Describe("Common", func() {
|
||||
var validSecretSourceValue []byte
|
||||
var validSecretSourceValue string
|
||||
const validSecretSourceEnv = "OAUTH2_PROXY_TEST_SECRET_SOURCE_ENV"
|
||||
var validSecretSourceFile string
|
||||
|
||||
BeforeEach(func() {
|
||||
validSecretSourceValue = []byte("This is a secret source value")
|
||||
validSecretSourceValue = "This is a secret source value"
|
||||
Expect(os.Setenv(validSecretSourceEnv, "This is a secret source env")).To(Succeed())
|
||||
tmp, err := os.CreateTemp("", "oauth2-proxy-secret-source-test")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
@@ -51,11 +51,9 @@ func validateHeaderValue(_ string, value options.HeaderValue) []string {
|
||||
|
||||
func validateHeaderValueClaimSource(claim options.ClaimSource) []string {
|
||||
msgs := []string{}
|
||||
|
||||
if claim.Claim == "" {
|
||||
msgs = append(msgs, "claim should not be empty")
|
||||
}
|
||||
|
||||
if claim.BasicAuthPassword != nil {
|
||||
msgs = append(msgs, prefixValues("invalid basicAuthPassword: ", validateSecretSource(*claim.BasicAuthPassword))...)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ var _ = Describe("Headers", func() {
|
||||
Values: []options.HeaderValue{
|
||||
{
|
||||
SecretSource: &options.SecretSource{
|
||||
Value: []byte(base64.StdEncoding.EncodeToString([]byte("secret"))),
|
||||
Value: base64.StdEncoding.EncodeToString([]byte("secret")),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -43,7 +43,7 @@ var _ = Describe("Headers", func() {
|
||||
ClaimSource: &options.ClaimSource{
|
||||
Claim: "email",
|
||||
BasicAuthPassword: &options.SecretSource{
|
||||
Value: []byte(base64.StdEncoding.EncodeToString([]byte("secret"))),
|
||||
Value: base64.StdEncoding.EncodeToString([]byte("secret")),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -69,7 +69,7 @@ func validateStaticUpstream(upstream options.Upstream) []string {
|
||||
if upstream.InsecureSkipTLSVerify {
|
||||
msgs = append(msgs, fmt.Sprintf("upstream %q has insecureSkipTLSVerify, but is a static upstream, this will have no effect.", upstream.ID))
|
||||
}
|
||||
if upstream.FlushInterval != nil && upstream.FlushInterval.Duration() != options.DefaultUpstreamFlushInterval {
|
||||
if upstream.FlushInterval != nil && *upstream.FlushInterval != options.DefaultUpstreamFlushInterval {
|
||||
msgs = append(msgs, fmt.Sprintf("upstream %q has flushInterval, but is a static upstream, this will have no effect.", upstream.ID))
|
||||
}
|
||||
if upstream.PassHostHeader != nil {
|
||||
|
||||
@@ -14,7 +14,7 @@ var _ = Describe("Upstreams", func() {
|
||||
errStrings []string
|
||||
}
|
||||
|
||||
flushInterval := options.Duration(5 * time.Second)
|
||||
flushInterval := 5 * time.Second
|
||||
staticCode200 := 200
|
||||
truth := true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user