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

93 Commits

Author SHA1 Message Date
kolaente d7b5801549
chore: reset pnpm lock
continuous-integration/drone/pr Build is passing Details
2024-03-02 09:31:08 +01:00
kolaente f99459f929
docs: add link to Keycloak mapper 2024-03-02 09:31:08 +01:00
kolaente 4d887710de
docs: remove duplicates 2024-03-02 09:31:08 +01:00
kolaente 45bff868ab
docs: add scope mapping to provider 2024-03-02 09:31:08 +01:00
kolaente e95adab54c
chore: update pnpm lockfile 2024-03-02 09:31:08 +01:00
viehlieb efade3563d
restore pnpm.lock from main 2024-03-02 09:31:08 +01:00
viehlieb 75c3c0fc91
add frontend code from #3033 2024-03-02 09:31:04 +01:00
viehlieb 914bcfabbc
work on docs 2024-03-02 09:31:00 +01:00
viehlieb 4771e7f05a
changed assert to require in openid test 2024-03-02 09:31:00 +01:00
viehlieb 85406f6847
adding authentik setup to openid-examples, some work in documentation 2024-03-02 09:31:00 +01:00
viehlieb ec39d9f02a
tiny changes in openid.go, revert error.go, link to docs 2024-03-02 09:31:00 +01:00
kolaente 7011df8876
chore: refactor 2024-03-02 09:31:00 +01:00
kolaente 48ba083226
docs: expand openid docs 2024-03-02 09:31:00 +01:00
viehlieb aaa090f6bb
fix lint and add test 2024-03-02 09:31:00 +01:00
viehlieb c6100ceb5a
tests and fixes 2024-03-02 09:31:00 +01:00
viehlieb c283e876b0
delete sso teams on login if empty 2024-03-02 09:31:00 +01:00
viehlieb 1ef77a1b19
minor changes in teams.go and consistent attribute renaming in openid.md 2024-03-02 09:31:00 +01:00
viehlieb 29e5356477
use one sql query for removing user form team 2024-03-02 09:31:00 +01:00
viehlieb bd66275acd
tiny changes in openid.md 2024-03-02 09:31:00 +01:00
viehlieb a7fa02a4d6
fix lint 2024-03-02 09:30:59 +01:00
viehlieb 042f588001
fix typos 2024-03-02 09:30:59 +01:00
viehlieb 9b4be16d50
do-the swag 2024-03-02 09:30:59 +01:00
viehlieb af2460c1f9
fixsomerebase errs 2024-03-02 09:30:59 +01:00
viehlieb 9011668512
change openid.md directory, modify openid.md 2024-03-02 09:30:59 +01:00
viehlieb c398436ad7
change error note and append team pointer in GetOrCreateTeamsByOIDCAndNames 2024-03-02 09:30:59 +01:00
viehlieb 6d33a513be
return pointer to team 2024-03-02 09:30:59 +01:00
viehlieb 7019a72065
add to error.md change error msg 2024-03-02 09:30:59 +01:00
viehlieb 583fe9a655
fix rebase error 2024-03-02 09:30:59 +01:00
viehlieb da12af7135
refactor unused function GetTeamsByName 2024-03-02 09:30:59 +01:00
viehlieb 46a6456bae
work on openid to just start group workflow when teamData is available 2024-03-02 09:30:59 +01:00
viehlieb 7308596370
work on instructions for openid.md 2024-03-02 09:30:59 +01:00
viehlieb 3f4b3853a3
fix limit GetTeamByOidcIDAndName to get a single team 2024-03-02 09:30:59 +01:00
viehlieb 2af1679daf
return single team for GetTeamByOidcIDAndName 2024-03-02 09:30:58 +01:00
viehlieb ffeae4065c
add swagger files 2024-03-02 09:30:58 +01:00
viehlieb 47801df974
remove left over function GetMemberCount, rename function SignOut to RemoveFrom 2024-03-02 09:30:58 +01:00
viehlieb bf87763b2f
change generic name TeamData struct to OIDCTeamData 2024-03-02 09:30:58 +01:00
viehlieb 3a3aa57ca4
cast VikunjaGroups directly to []map[string]interface{}
changing []models.Team to []*models.Team
2024-03-02 09:30:58 +01:00
viehlieb 8045d68c2e
add punctuation and comments for errors 2024-03-02 09:30:58 +01:00
viehlieb 6bd5efa00b
undo team gets deleted if user is last team member
remove logic behind deleting last team_member
2024-03-02 09:30:58 +01:00
viehlieb 60bd4611b2
fix lint 2024-03-02 09:30:58 +01:00
viehlieb 7f9c48c87a
make documentation cleaner 2024-03-02 09:30:58 +01:00
viehlieb 105df8588e
rework openid.go, add errors to return, make team deletion more robust 2024-03-02 09:30:58 +01:00
viehlieb 6f2cd6c99a
use models.TeamData instead of declaring struct twice 2024-03-02 09:30:58 +01:00
viehlieb 696cc951fa
remove manage admin function, nullcheck for oidc_id, undo removal of * in method TableName 2024-03-02 09:30:58 +01:00
viehlieb 23bbc97230
add errors to error doc, rewrite error messages
specify error on teams model, add more declarative error

specify error message on ErrOIDCTeamDoesNotExist
2024-03-02 09:30:58 +01:00
viehlieb e9d6992567
do the swag 2024-03-02 09:30:57 +01:00
viehlieb 263250a705
add openid.md as readme for feature: 950 assigning group through oidc claim 2024-03-02 09:30:57 +01:00
viehlieb 8652cf9874
add config.yml.sample for seting up vikunja_scope and group assignment feature 2024-03-02 09:30:57 +01:00
viehlieb 6d24e35671
remove user from all oidc teams if token is empty 2024-03-02 09:30:57 +01:00
viehlieb 12242d9c6f
add functionality for deleting user only from oidc teams which are not present in the current token 2024-03-02 09:30:57 +01:00
viehlieb 274dbecae5
change method function to GetOrCreateTeamsByOIDCAndNames 2024-03-02 09:30:57 +01:00
viehlieb 0c3a12bcf7
do the swag 2024-03-02 09:30:57 +01:00
viehlieb ac032400d6
add functionality to assign user to teams through oidc custom claim 2024-03-02 09:30:57 +01:00
viehlieb 905df6ebc0
add TeamData struct to openid.go 2024-03-02 09:30:57 +01:00
viehlieb 9fce32c7e9
add functionality of searching teams by oidcId and name to teams.go 2024-03-02 09:30:57 +01:00
viehlieb 044bb07e9d
add OidcIDto teams 2024-03-02 09:30:57 +01:00
viehlieb 95ce28b6e5
wip assign groups via oidc 2024-03-02 09:30:57 +01:00
viehlieb ed91d6744e
introduce functionality to assign/create team via group claim 2024-03-02 09:30:56 +01:00
viehlieb 01a56019e9
refactor unused function GetTeamsByName 2024-03-02 09:30:56 +01:00
viehlieb d345fbb1d4
work on openid to just start group workflow when teamData is available 2024-03-02 09:30:56 +01:00
viehlieb ffa894ecd1
work on instructions for openid.md 2024-03-02 09:30:56 +01:00
viehlieb 74990b88fa
fix limit GetTeamByOidcIDAndName to get a single team 2024-03-02 09:30:56 +01:00
viehlieb 1ad439f029
return single team for GetTeamByOidcIDAndName 2024-03-02 09:30:56 +01:00
viehlieb 061c2a4b7e
remove left over function GetMemberCount, rename function SignOut to RemoveFrom 2024-03-02 09:30:56 +01:00
viehlieb a3e4449b7b
change too generic name TeamData struct to OIDCTeamData 2024-03-02 09:30:56 +01:00
viehlieb c3a1a5062a
cast VikujGroups directly to []map[string]interface{}
changug []models.Team to []*models.Team
2024-03-02 09:30:56 +01:00
viehlieb 50a5825bce
add punctuation and comments for errors 2024-03-02 09:30:56 +01:00
viehlieb 9dd3317908
change get to exist in team_members.go:114 2024-03-02 09:30:56 +01:00
viehlieb 3a75aa99fe
undo team gets deleted if user is last team member
remove logic behind deleting last team_member
2024-03-02 09:30:56 +01:00
viehlieb 8c65f632fb
fix lint 2024-03-02 09:30:56 +01:00
viehlieb ef854b1871
make documentation cleaner 2024-03-02 09:30:56 +01:00
viehlieb 3c51966b08
rework openid.go, add errors to return, make team deletion more robust 2024-03-02 09:30:55 +01:00
viehlieb 0f04ac2519
move find x not in y for int64 slices to utils 2024-03-02 09:30:55 +01:00
viehlieb 7774cc5823
use models.TeamData instead of declaring struct twice 2024-03-02 09:30:55 +01:00
viehlieb a7c1fb919c
remove manage admin function, nullcheck for oidc_id, undo removal of * in method TableName 2024-03-02 09:30:55 +01:00
viehlieb 765cfae63a
rewok checkMembership to not load user and improvements on return val 2024-03-02 09:30:55 +01:00
viehlieb 99c987efc0
add errors to error doc, rewrite error messages
specify error on teams model, add more declarative error

specify error message on ErrOIDCTeamDoesNotExist
2024-03-02 09:30:55 +01:00
viehlieb 01ff27f25f
add openid.md as readme for feature: 950 assigning group through oidc claim 2024-03-02 09:30:55 +01:00
viehlieb 1ea033e0d2
add config.yml.sample for seting up vikunja_scope and group assignment feature 2024-03-02 09:30:55 +01:00
viehlieb 5942d78d8a
remove user from all oidc teams if token is empty 2024-03-02 09:30:55 +01:00
viehlieb 381a2bc3aa
make provider scopes more robust add default openid profile email 2024-03-02 09:30:55 +01:00
viehlieb a96dc36d58
add functionality for deleting user only from oidc teams which are not present in the current token 2024-03-02 09:30:55 +01:00
viehlieb 108c8daf24
change method function to GetOrCreateTeamsByOIDCAndNames 2024-03-02 09:30:55 +01:00
viehlieb c527149954
add functionality to assign user to teams through oidc custom claim 2024-03-02 09:30:55 +01:00
viehlieb dbc4970716
add TeamData struct to openid.go 2024-03-02 09:30:54 +01:00
viehlieb 7edcf1a24f
add VikunjaGroups to claums struct in openid.go 2024-03-02 09:30:54 +01:00
viehlieb f5c872d99b
add scope to provider 2024-03-02 09:30:54 +01:00
viehlieb 27eb746b98
add functionality of searching teams by oidcId and name to teams.go 2024-03-02 09:30:54 +01:00
viehlieb 7fb8968299
add OidcIDto teams 2024-03-02 09:30:54 +01:00
viehlieb 1c6553940e
add errors to user 2024-03-02 09:30:54 +01:00
viehlieb a4c8672a80
migration to add idcID to teams 2024-03-02 09:30:54 +01:00
viehlieb 97b13eecf3
wip assign groups via oidc 2024-03-02 09:30:54 +01:00
viehlieb 1123d7b98c
introduce functionality to assign/create team via group claim 2024-03-02 09:30:54 +01:00