Skip to content

Commit d3c33d9

Browse files
committed
Add connector config validation
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
1 parent bf6c56b commit d3c33d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/probod/connector_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ func (c *connectorConfig) UnmarshalJSON(data []byte) error {
5959
return fmt.Errorf("cannot unmarshal oauth2 config: %w", err)
6060
}
6161

62+
if cfg.ClientID == "" || cfg.ClientSecret == "" || cfg.AuthURL == "" || cfg.TokenURL == "" || cfg.RedirectURI == "" {
63+
return fmt.Errorf("oauth2 config: client-id, client-secret, auth-url, token-url and redirect-uri are required")
64+
}
65+
6266
c.Config = &connector.OAuth2Connector{
6367
ClientID: cfg.ClientID,
6468
ClientSecret: cfg.ClientSecret,

0 commit comments

Comments
 (0)