-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1396 from woogles-io/patreon
Patreon (Step 1)
- Loading branch information
Showing
43 changed files
with
1,487 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
meta { | ||
name: Get Campaign | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
get { | ||
url: https://www.patreon.com/api/oauth2/v2/campaigns/1311241?fields[campaign]=created_at,creation_name,discord_server_id,image_small_url,image_url,is_charged_immediately,is_monthly,main_video_embed,main_video_url,one_liner,one_liner,patron_count,pay_per_name,pledge_url,published_at,summary,thanks_embed,thanks_msg,thanks_video_url | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
fields[campaign]: created_at,creation_name,discord_server_id,image_small_url,image_url,is_charged_immediately,is_monthly,main_video_embed,main_video_url,one_liner,one_liner,patron_count,pay_per_name,pledge_url,published_at,summary,thanks_embed,thanks_msg,thanks_video_url | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
meta { | ||
name: Get Identity | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
get { | ||
url: https://www.patreon.com/api/oauth2/v2/identity?fields[user]=email,first_name,last_name&fields[campaign]=summary,is_monthly&fields[member]=full_name,is_follower,last_charge_date,last_charge_status,lifetime_support_cents,currently_entitled_amount_cents,patron_status&fields[tier]=amount_cents,created_at,description,discord_role_ids,edited_at,patron_count,published,published_at,requires_shipping,title,url&include=memberships | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
fields[user]: email,first_name,last_name | ||
fields[campaign]: summary,is_monthly | ||
fields[member]: full_name,is_follower,last_charge_date,last_charge_status,lifetime_support_cents,currently_entitled_amount_cents,patron_status | ||
fields[tier]: amount_cents,created_at,description,discord_role_ids,edited_at,patron_count,published,published_at,requires_shipping,title,url | ||
include: memberships | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: Get Member | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
get { | ||
url: https://www.patreon.com/api/oauth2/v2/members/b2fddab5-1ba5-402c-b825-7b4d8189c56a?fields[address]=line_1,line_2,addressee,postal_code,city&fields[member]=full_name,is_follower,last_charge_date&include=address,user | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
fields[address]: line_1,line_2,addressee,postal_code,city | ||
fields[member]: full_name,is_follower,last_charge_date | ||
include: address,user | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": "1", | ||
"name": "patreon", | ||
"type": "collection", | ||
"ignore": [ | ||
"node_modules", | ||
".git" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
auth { | ||
mode: bearer | ||
} | ||
|
||
auth:bearer { | ||
token: {{PATREON_TOKEN}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
vars:secret [ | ||
PATREON_TOKEN | ||
] |
19 changes: 19 additions & 0 deletions
19
bruno/woogles-api/AuthenticationService/ChangePassword.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
meta { | ||
name: ChangePassword | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{baseURL}}/api/user_service.AuthenticationService/ChangePassword | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
Cookie: session=yTJ8D2zEKQkxmnyUAGe7dJ | ||
} | ||
|
||
body:json { | ||
{"old_password": "cesar", "password": "{{goodpassword}}"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
meta { | ||
name: Login | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{baseURL}}/api/user_service.AuthenticationService/Login | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
: | ||
} | ||
|
||
body:json { | ||
{"username": "cesar", "password": "{{goodpassword}}"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: Get User Details | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{baseURL}}/api/config_service.ConfigService/GetUserDetails | ||
body: json | ||
auth: none | ||
} | ||
|
||
body:json { | ||
{ | ||
"username": "rightbehindyou" | ||
} | ||
} | ||
|
||
assert { | ||
res.body.is_admin: eq true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
meta { | ||
name: Register | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{baseURL}}/api/user_service.RegistrationService/Register | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
: | ||
} | ||
|
||
body:json { | ||
{"username": "use-a-slur-here-for-testing", "password": "password", "email": "foo"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
meta { | ||
name: Set User Permissions | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
post { | ||
url: {{baseURL}}/api/config_service.ConfigService/SetUserPermissions | ||
body: json | ||
auth: none | ||
} | ||
|
||
body:json { | ||
{ | ||
"username": "penumbra", | ||
"director": false, | ||
"admin": false, | ||
"mod": true, | ||
"bot": false | ||
|
||
} | ||
} | ||
|
||
assert { | ||
res.body.is_admin: eq true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
meta { | ||
name: GetChatsForChannel | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{baseURL}}/api/user_service.SocializeService/GetChatsForChannel | ||
body: json | ||
auth: none | ||
} | ||
|
||
body:json { | ||
{ | ||
"channel": "chat.game.q4JhmVVm" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": "1", | ||
"name": "woogles-api", | ||
"type": "collection", | ||
"ignore": [ | ||
"node_modules", | ||
".git" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
headers { | ||
X-Api-Key: {{APIKey}} | ||
Content-Type: application/json | ||
} | ||
|
||
auth { | ||
mode: none | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
vars { | ||
baseURL: http://liwords.localhost | ||
} | ||
vars:secret [ | ||
goodpassword | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
vars { | ||
baseURL: https://woogles.io | ||
} | ||
vars:secret [ | ||
APIKey | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BEGIN; | ||
|
||
DROP TABLE integrations; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
BEGIN; | ||
|
||
CREATE TABLE integrations ( | ||
id BIGSERIAL PRIMARY KEY, | ||
uuid UUID DEFAULT gen_random_uuid () NOT NULL UNIQUE, | ||
user_id BIGINT NOT NULL, | ||
integration_name TEXT NOT NULL, | ||
data JSONB NOT NULL DEFAULT '{}'::jsonb, | ||
FOREIGN KEY (user_id) REFERENCES users (id), | ||
UNIQUE(user_id, integration_name) | ||
); | ||
|
||
CREATE INDEX integrations_user_idx ON integrations USING btree(user_id); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- name: AddOrUpdateIntegration :one | ||
INSERT INTO integrations(user_id, integration_name, data) | ||
VALUES ( | ||
(SELECT id FROM users WHERE users.uuid = @user_uuid), | ||
$1, | ||
$2 | ||
) | ||
ON CONFLICT (user_id, integration_name) | ||
DO UPDATE SET data = EXCLUDED.data | ||
RETURNING integrations.uuid; | ||
|
||
-- name: GetIntegrations :many | ||
SELECT uuid, integration_name FROM integrations | ||
WHERE user_id = (SELECT id from users where users.uuid = @user_uuid); | ||
|
||
-- name: GetIntegrationData :one | ||
SELECT data FROM integrations | ||
WHERE uuid = $1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PUBLIC_PATREON_CLIENT_ID=UhLzukHPyjascp5vNI0_AP5z_ABiz_6-sqU_y8YALVxiiJSxBqRQWFXxAox5vuqE | ||
PUBLIC_PATREON_REDIRECT_URL=http://localhost/integrations/patreon/callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PUBLIC_PATREON_CLIENT_ID=VRup-HOI7HQ7bzBqrN2J4S9y1GRWtZcAW1aot8vdjnGQJv1V9hwItPhhIv-X68Wk | ||
PUBLIC_PATREON_REDIRECT_URL=https://woogles.io/integrations/patreon/callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.