Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
set -x

if [ ! -z $(gofmt -l .) ]
if [ -n "$(gofmt -s -l .)" ]
then
echo 'Make sure to run "gofmt -s -w ." before commit!' && exit 1
fi
Expand Down
12 changes: 6 additions & 6 deletions internal/api/oauthserver/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ func (s *Server) regenerateOAuthServerClientSecret(ctx context.Context, clientID

// OAuthServerClientUpdateParams contains parameters for updating an OAuth client
type OAuthServerClientUpdateParams struct {
RedirectURIs *[]string `json:"redirect_uris,omitempty"`
GrantTypes *[]string `json:"grant_types,omitempty"`
ClientName *string `json:"client_name,omitempty"`
ClientURI *string `json:"client_uri,omitempty"`
LogoURI *string `json:"logo_uri,omitempty"`
TokenEndpointAuthMethod *string `json:"token_endpoint_auth_method,omitempty"`
RedirectURIs *[]string `json:"redirect_uris,omitempty"`
GrantTypes *[]string `json:"grant_types,omitempty"`
ClientName *string `json:"client_name,omitempty"`
ClientURI *string `json:"client_uri,omitempty"`
LogoURI *string `json:"logo_uri,omitempty"`
TokenEndpointAuthMethod *string `json:"token_endpoint_auth_method,omitempty"`
}

// isEmpty returns true if no fields are set for update
Expand Down
4 changes: 2 additions & 2 deletions internal/api/provider/custom_oauth_claims_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestCustomOIDCProvider_GetUserData_UserinfoAllowlist(t *testing.T) {
provider, err := NewCustomOIDCProvider(
context.Background(),
"client-id", "client-secret", "https://myapp.com/callback",
[]string{"openid"}, server.URL, server.URL + "/.well-known/openid-configuration", false,
[]string{"openid"}, server.URL, server.URL+"/.well-known/openid-configuration", false,
nil, nil, nil,
[]string{"mail", "sn"},
newTestOIDCProviderCache(t, 0),
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestCustomOIDCProvider_GetUserData_IDTokenAllowlist(t *testing.T) {
provider, err := NewCustomOIDCProvider(
context.Background(),
"client-id", "client-secret", "https://myapp.com/callback",
[]string{"openid"}, server.URL, server.URL + "/.well-known/openid-configuration", false,
[]string{"openid"}, server.URL, server.URL+"/.well-known/openid-configuration", false,
nil, nil, nil,
[]string{"groups", "org_id"},
newTestOIDCProviderCache(t, 0),
Expand Down
34 changes: 17 additions & 17 deletions internal/api/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,24 @@ type Claims struct {
Exp float64 `json:"exp,omitempty" structs:"exp,omitempty"`

// Default profile claims
Name string `json:"name,omitempty" structs:"name,omitempty"`
FamilyName string `json:"family_name,omitempty" structs:"family_name,omitempty"`
GivenName string `json:"given_name,omitempty" structs:"given_name,omitempty"`
MiddleName string `json:"middle_name,omitempty" structs:"middle_name,omitempty"`
NickName string `json:"nickname,omitempty" structs:"nickname,omitempty"`
PreferredUsername string `json:"preferred_username,omitempty" structs:"preferred_username,omitempty"`
Profile string `json:"profile,omitempty" structs:"profile,omitempty"`
Picture string `json:"picture,omitempty" structs:"picture,omitempty"`
Website string `json:"website,omitempty" structs:"website,omitempty"`
Gender string `json:"gender,omitempty" structs:"gender,omitempty"`
Birthdate string `json:"birthdate,omitempty" structs:"birthdate,omitempty"`
ZoneInfo string `json:"zoneinfo,omitempty" structs:"zoneinfo,omitempty"`
Locale string `json:"locale,omitempty" structs:"locale,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
FamilyName string `json:"family_name,omitempty" structs:"family_name,omitempty"`
GivenName string `json:"given_name,omitempty" structs:"given_name,omitempty"`
MiddleName string `json:"middle_name,omitempty" structs:"middle_name,omitempty"`
NickName string `json:"nickname,omitempty" structs:"nickname,omitempty"`
PreferredUsername string `json:"preferred_username,omitempty" structs:"preferred_username,omitempty"`
Profile string `json:"profile,omitempty" structs:"profile,omitempty"`
Picture string `json:"picture,omitempty" structs:"picture,omitempty"`
Website string `json:"website,omitempty" structs:"website,omitempty"`
Gender string `json:"gender,omitempty" structs:"gender,omitempty"`
Birthdate string `json:"birthdate,omitempty" structs:"birthdate,omitempty"`
ZoneInfo string `json:"zoneinfo,omitempty" structs:"zoneinfo,omitempty"`
Locale string `json:"locale,omitempty" structs:"locale,omitempty"`
UpdatedAt *UnixTimeOrString `json:"updated_at,omitempty" structs:"updated_at,omitempty"`
Email string `json:"email,omitempty" structs:"email,omitempty"`
EmailVerified bool `json:"email_verified,omitempty" structs:"email_verified"`
Phone string `json:"phone,omitempty" structs:"phone,omitempty"`
PhoneVerified bool `json:"phone_verified,omitempty" structs:"phone_verified"`
Email string `json:"email,omitempty" structs:"email,omitempty"`
EmailVerified bool `json:"email_verified,omitempty" structs:"email_verified"`
Phone string `json:"phone,omitempty" structs:"phone,omitempty"`
PhoneVerified bool `json:"phone_verified,omitempty" structs:"phone_verified"`

// Custom profile claims that are provider specific
CustomClaims map[string]interface{} `json:"custom_claims,omitempty" structs:"custom_claims,omitempty"`
Expand Down
22 changes: 11 additions & 11 deletions internal/api/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ type ProviderSettings struct {
}

type Settings struct {
ExternalProviders ProviderSettings `json:"external"`
DisableSignup bool `json:"disable_signup"`
MailerAutoconfirm bool `json:"mailer_autoconfirm"`
PhoneAutoconfirm bool `json:"phone_autoconfirm"`
SmsProvider string `json:"sms_provider"`
SAMLEnabled bool `json:"saml_enabled"`
SAMLPrivateKeyNextConfigured bool `json:"saml_private_key_next_configured"`
PasskeysEnabled bool `json:"passkeys_enabled"`
ExternalProviders ProviderSettings `json:"external"`
DisableSignup bool `json:"disable_signup"`
MailerAutoconfirm bool `json:"mailer_autoconfirm"`
PhoneAutoconfirm bool `json:"phone_autoconfirm"`
SmsProvider string `json:"sms_provider"`
SAMLEnabled bool `json:"saml_enabled"`
SAMLPrivateKeyNextConfigured bool `json:"saml_private_key_next_configured"`
PasskeysEnabled bool `json:"passkeys_enabled"`
}

func (a *API) Settings(w http.ResponseWriter, r *http.Request) error {
Expand Down Expand Up @@ -74,9 +74,9 @@ func (a *API) Settings(w http.ResponseWriter, r *http.Request) error {
Phone: config.External.Phone.Enabled,
Zoom: config.External.Zoom.Enabled,
},
DisableSignup: config.DisableSignup,
MailerAutoconfirm: config.Mailer.Autoconfirm,
PhoneAutoconfirm: config.Sms.Autoconfirm,
DisableSignup: config.DisableSignup,
MailerAutoconfirm: config.Mailer.Autoconfirm,
PhoneAutoconfirm: config.Sms.Autoconfirm,
SmsProvider: config.Sms.Provider,
SAMLEnabled: config.SAML.Enabled,
SAMLPrivateKeyNextConfigured: config.SAML.CertificateNext != nil,
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/confload/confload.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ func loadEnvironment(filename string) error {
}
}
return err
}
}