IAM: Implement create method for team bindings (#112003)

* implement create method for team bindings

* generate openapi specs

* enable dual writer for team bindings

* add validation rules

* generate openapi

* add integration tests and fix remaining issues

* fix validation test

* use UIDs instead of IDs to build team binding name

* use IDs when generating the TeamBinding name

* fix build error

* remove time truncate
This commit is contained in:
Mihai Doarna
2025-10-14 17:20:59 +03:00
committed by GitHub
parent aeb041a9af
commit 7395f803c1
34 changed files with 1494 additions and 124 deletions
@@ -1,11 +1,14 @@
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, tm.created, tm.updated, tm.permission
SELECT tm.id as id, t.uid as team_uid, t.id as team_id, u.uid as user_uid, u.id as user_id, tm.created, tm.updated, tm.permission
FROM {{ .Ident .TeamMemberTable }} tm
INNER JOIN {{ .Ident .TeamTable }} t ON tm.team_id = t.id
INNER JOIN {{ .Ident .UserTable }} u ON tm.user_id = u.id
WHERE
tm.org_id = {{ .Arg .Query.OrgID}}
{{ if .Query.UID }}
AND t.uid = {{ .Arg .Query.UID }}
{{ if .Query.TeamID }}
AND t.id = {{ .Arg .Query.TeamID }}
{{ end }}
{{ if .Query.UserID }}
AND u.id = {{ .Arg .Query.UserID }}
{{ end }}
{{- if .Query.Pagination.Continue }}
AND tm.id >= {{ .Arg .Query.Pagination.Continue }}