* wip * IAM: Create Service Account * Add dual writer * Update openapi_test.go * Add integration tests * Add sql tests * Add Role to SA spec, add validation, add DBTime, add tests * Format, update test * Fixes * Add check for External * Address feedback * Update tests * Address feedback * make gen-go * Simplify a bit * Fixes * make update-workspace * Update pkg/registry/apis/iam/serviceaccount/store.go Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Address feedback, add test for generateName --------- Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
20 lines
476 B
SQL
20 lines
476 B
SQL
SELECT
|
|
u.id,
|
|
u.uid,
|
|
u.name,
|
|
u.is_disabled,
|
|
o.role,
|
|
u.created,
|
|
u.updated
|
|
FROM {{ .Ident .UserTable }} as u JOIN {{ .Ident .OrgUserTable }} as o ON u.id = o.user_id
|
|
WHERE o.org_id = {{ .Arg .Query.OrgID }}
|
|
AND u.is_service_account
|
|
{{ if .Query.UID }}
|
|
AND u.uid = {{ .Arg .Query.UID }}
|
|
{{ end }}
|
|
{{ if .Query.Pagination.Continue }}
|
|
AND u.id >= {{ .Arg .Query.Pagination.Continue }}
|
|
{{ end }}
|
|
ORDER BY u.id asc
|
|
LIMIT {{ .Arg .Query.Pagination.Limit }}
|