summaryrefslogtreecommitdiff
path: root/create-user
blob: fbb93a6f3244555ce0339d96e3233b840bc0f70f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

set -eu

scopes="
uapi_blobs_id_get
uapi_blobs_id_put
uapi_builds_get
uapi_builds_id_delete
uapi_builds_id_get
uapi_logs_get
uapi_logs_id_delete
uapi_logs_id_get
uapi_pipelines_get
uapi_pipelines_id_delete
uapi_pipelines_id_get
uapi_pipelines_id_put
uapi_pipelines_post
uapi_projects_get
uapi_projects_id_delete
uapi_projects_id_get
uapi_projects_id_put
uapi_projects_id_status_get
uapi_projects_id_status_put
uapi_projects_post
uapi_status_get
uapi_version_get
uapi_workers_get
uapi_workers_id_delete
uapi_workers_id_get
create
update
show
delete
uapi_work_get
uapi_work_post
uapi_workers_post
"

api="$1"
name="$2"
secret="$3"

qvisqvetool -a "$api" delete client "$name" || true
qvisqvetool -a "$api" create client "$name" "$secret"
qvisqvetool -a "$api" allow-scope client "$name" $scopes