feat: assign users to teams via OIDC claims #1393

Merged
konrad merged 93 commits from viehlieb/api:950_reworked_assign_teams_via_oidc into main 2024-03-02 08:47:12 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 7019a72065 - Show all commits

View File

@ -44,6 +44,7 @@ This document describes the different errors Vikunja can return.
| 1020 | 412 | This user account is disabled. |
| 1021 | 412 | This account is managed by a third-party authentication provider. |
| 1021 | 412 | The username must not contain spaces. |
| 1022 | 412 | The custom scope set by the OIDC provider is malformed. Please make sure the openid provider sets the data correctly for your scope. Check especially to have set an oidcID. |
## Validation

View File

@ -1191,7 +1191,7 @@ func IsErrOIDCTeamDoesNotExist(err error) bool {
// ErrTeamDoesNotExist represents an error where a team does not exist
func (err ErrOIDCTeamDoesNotExist) Error() string {
viehlieb marked this conversation as resolved Outdated

Please add a comment, similar to the other errors.

Please add a comment, similar to the other errors.
return fmt.Sprintf("No Team with that name and valid property oidcId could be found [Team Name: %v] [OidcId : %v] ", err.Name, err.OidcID)
return fmt.Sprintf("No Team with that name and valid oidcId could be found. [Team Name: %v] [OidcId : %v] ", err.Name, err.OidcID)
}
// ErrCodeTeamDoesNotExist holds the unique world-error code of this error
@ -1199,7 +1199,7 @@ const ErrCodeOIDCTeamDoesNotExist = 6008
// HTTPError holds the http error description
func (err ErrOIDCTeamDoesNotExist) HTTPError() web.HTTPError {
return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No Team with that name and valid property oidcId could be found."}
return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No Team with that name and valid oidcId could be found."}
}
viehlieb marked this conversation as resolved Outdated

Is this an error about one team not existing or multiple? Because the error name suggests one or more teams but the error message is about only one.

Is this an error about one team not existing or multiple? Because the error name suggests one or more teams but the error message is about only one.
// ErrOIDCTeamsDoNotExistForUser represents an error where an oidcTeam does not exist for the user