From 0ed827fc9a364fbe9798110624abb3a75fcc21b7 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 30 Jul 2024 12:57:08 -0400 Subject: [PATCH] added simkl gettoken to bruno --- SimklFunctions.go | 1 + SimklUserFunctions.go | 1 + bruno/AniTrack/Simkl/Get Code.bru | 29 +++++++++++++++ .../Simkl/SimklGetAuthorizationToken.bru | 37 +++++++++++++++++++ bruno/AniTrack/environments/Dev.bru | 1 + 5 files changed, 69 insertions(+) create mode 100644 SimklFunctions.go create mode 100644 SimklUserFunctions.go create mode 100644 bruno/AniTrack/Simkl/Get Code.bru create mode 100644 bruno/AniTrack/Simkl/SimklGetAuthorizationToken.bru diff --git a/SimklFunctions.go b/SimklFunctions.go new file mode 100644 index 0000000..06ab7d0 --- /dev/null +++ b/SimklFunctions.go @@ -0,0 +1 @@ +package main diff --git a/SimklUserFunctions.go b/SimklUserFunctions.go new file mode 100644 index 0000000..06ab7d0 --- /dev/null +++ b/SimklUserFunctions.go @@ -0,0 +1 @@ +package main diff --git a/bruno/AniTrack/Simkl/Get Code.bru b/bruno/AniTrack/Simkl/Get Code.bru new file mode 100644 index 0000000..0ae710c --- /dev/null +++ b/bruno/AniTrack/Simkl/Get Code.bru @@ -0,0 +1,29 @@ +meta { + name: Get Code + type: http + seq: 1 +} + +get { + url: https://simkl.com/oauth/authorize?response_type=code&client_id={{SIMKL_CLIENT_ID}}&redirect_uri=http://localhost:6734/callback + body: none + auth: oauth2 +} + +params:query { + response_type: code + client_id: {{SIMKL_CLIENT_ID}} + redirect_uri: http://localhost:6734/callback +} + +auth:oauth2 { + grant_type: authorization_code + callback_url: http://localhost:6734/callback + authorization_url: https://api.simkl.com/oauth/authorize + access_token_url: https://api.simkl.com/oauth/token + client_id: {{SIMKL_CLIENT_ID}} + client_secret: {{SIMKL_CLIENT_SECRET}} + scope: + state: + pkce: false +} diff --git a/bruno/AniTrack/Simkl/SimklGetAuthorizationToken.bru b/bruno/AniTrack/Simkl/SimklGetAuthorizationToken.bru new file mode 100644 index 0000000..9ef3b8c --- /dev/null +++ b/bruno/AniTrack/Simkl/SimklGetAuthorizationToken.bru @@ -0,0 +1,37 @@ +meta { + name: SimklGetAuthorizationToken + type: http + seq: 2 +} + +post { + url: https://api.simkl.com/oauth/token + body: json + auth: none +} + +headers { + Content-Type: application/json +} + +body:json { + { + "grant_type": "authorization_code", + "client_id": "{{SIMKL_CLIENT_ID}}", + "client_secret": "{{SIMKL_CLIENT_SECRET}}", + "redirect_uri": "http://localhost:6734/callback", + "code": "c2b956d5086c5515ff518bfb2857d7f55453f5f8a8e245f6a37c2e3838fe1a7a" + } +} + +body:form-urlencoded { + grant_type: authorization_code + client_id: {{SIMKL_CLIENT_ID}} + client_secret: {{SIMKL_CLIENT_SECRET}} + redirect_uri: http://localhost:6734/callback + code: c2b956d5086c5515ff518bfb2857d7f55453f5f8a8e245f6a37c2e3838fe1a7a +} + +body:multipart-form { + : +} diff --git a/bruno/AniTrack/environments/Dev.bru b/bruno/AniTrack/environments/Dev.bru index d188630..7002ac7 100644 --- a/bruno/AniTrack/environments/Dev.bru +++ b/bruno/AniTrack/environments/Dev.bru @@ -2,6 +2,7 @@ vars { ANILIST_APP_ID: {{process.env.ANILIST_APP_ID}} ANILIST_SECRET_TOKEN: {{process.env.ANILIST_SECRET_TOKEN}} SIMKL_CLIENT_ID: {{process.env.SIMKL_CLIENT_ID}} + SIMKL_CLIENT_SECRET: {{process.env.SIMKL_CLIENT_SECRET}} } vars:secret [ code