forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0027.yml
53 lines (52 loc) · 1.9 KB
/
0027.yml
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
47
48
49
50
51
52
53
version: 27
description: web-server github access tokens phase 2 step 1+2
migrationScript: 0027-migration.sql
downgradeScript: 0027-downgrade.sql
methods:
# in the interests of time, this migration drops all existing table rows, and the
# corresponding DB functions cease to function. GitHub logins will fail during this
# time, as noted in the release notes.
github_access_token_table_entities_load:
deprecated: true
github_access_token_table_entities_create:
deprecated: true
github_access_token_table_entities_remove:
deprecated: true
github_access_token_table_entities_modify:
deprecated: true
github_access_token_table_entities_scan:
deprecated: true
add_github_access_token:
description: |-
Sets the encrypted access token for `user_id_in` to
`encrypted_access_token_in`.
If no access token is currently set for `user_id_in`, a new row is
inserted, otherwise the existing row's encrypted access token is updated
to `encrypted_access_token_in`.
mode: write
serviceName: web_server
args: user_id_in text, encrypted_access_token_in jsonb
returns: void
body: |-
begin
insert into github_access_tokens(user_id, encrypted_access_token)
values (
user_id_in,
encrypted_access_token_in
) on conflict (user_id) do
update
set encrypted_access_token = encrypted_access_token_in
where github_access_tokens.user_id = add_github_access_token.user_id_in;
end
load_github_access_token:
description: Returns the encrypted github access token for a given user.
mode: read
serviceName: web_server
args: user_id_in text
returns: table(encrypted_access_token jsonb)
body: |-
begin
return query
select github_access_tokens.encrypted_access_token from github_access_tokens
where github_access_tokens.user_id = user_id_in;
end