-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fail on invalid config. (#8295)
Signed-off-by: Alex Collins <alex_collins@intuit.com>
- Loading branch information
Showing
12 changed files
with
64 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package config | ||
|
||
type RBACConfig struct { | ||
Enabled bool `json:"enabled,omitempty"` | ||
} | ||
|
||
func (c *RBACConfig) IsEnabled() bool { | ||
return c != nil && c.Enabled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package config | ||
|
||
import ( | ||
"time" | ||
|
||
apiv1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type SSOConfig struct { | ||
Issuer string `json:"issuer"` | ||
IssuerAlias string `json:"issuerAlias,omitempty"` | ||
ClientID apiv1.SecretKeySelector `json:"clientId"` | ||
ClientSecret apiv1.SecretKeySelector `json:"clientSecret"` | ||
RedirectURL string `json:"redirectUrl"` | ||
RBAC *RBACConfig `json:"rbac,omitempty"` | ||
// additional scopes (on top of "openid") | ||
Scopes []string `json:"scopes,omitempty"` | ||
SessionExpiry metav1.Duration `json:"sessionExpiry,omitempty"` | ||
// customGroupClaimName will override the groups claim name | ||
CustomGroupClaimName string `json:"customGroupClaimName,omitempty"` | ||
UserInfoPath string `json:"userInfoPath,omitempty"` | ||
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` | ||
} | ||
|
||
func (c SSOConfig) GetSessionExpiry() time.Duration { | ||
if c.SessionExpiry.Duration > 0 { | ||
return c.SessionExpiry.Duration | ||
} | ||
return 10 * time.Hour | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,3 @@ data: | |
completed: 10 | ||
failed: 2 | ||
errored: 2 | ||
kubeletInsecure: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters