Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auth_url to api key #163

Merged
merged 3 commits into from
Nov 22, 2021
Merged

add auth_url to api key #163

merged 3 commits into from
Nov 22, 2021

Conversation

SimonLab
Copy link
Member

ref: #162

@SimonLab SimonLab self-assigned this Nov 15, 2021
@SimonLab SimonLab temporarily deployed to dwylauth November 15, 2021 11:47 Inactive
@codecov
Copy link

codecov bot commented Nov 15, 2021

Codecov Report

Merging #163 (0de2d6d) into main (165571d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #163   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          529       529           
=========================================
  Hits           529       529           
Impacted Files Coverage Δ
lib/auth_web/router.ex 100.00% <ø> (ø)
lib/auth_web/controllers/app_controller.ex 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 165571d...0de2d6d. Read the comment docs.

@SimonLab
Copy link
Member Author

Once dwyl/auth_plug#37 is deployed we can try to merge this PR and test the new version

@SimonLab SimonLab temporarily deployed to dwylauth November 18, 2021 13:11 Inactive
@@ -2,6 +2,8 @@ defmodule AuthWeb.AppController do
use AuthWeb, :controller
alias Auth.App

@auth_url "dwylauth.herokuapp.com"
Copy link
Member

@nelsonic nelsonic Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll actually need to determine this at runtime to avoid people having to update the code.
e.g. our "Dev" instance https://authdev.herokuapp.com/ should not need to update this line of code. 💭
See below https://github.com/dwyl/auth/pull/163/files#r753580287

@SimonLab SimonLab temporarily deployed to dwylauth November 22, 2021 11:00 Inactive
@SimonLab SimonLab temporarily deployed to dwylauth November 22, 2021 11:05 Inactive
@SimonLab SimonLab assigned nelsonic and unassigned SimonLab Nov 22, 2021
@SimonLab SimonLab added the awaiting-review An issue or pull request that needs to be reviewed label Nov 22, 2021
@SimonLab SimonLab marked this pull request as ready for review November 22, 2021 11:09
@SimonLab
Copy link
Member Author

I've updated auth_plug to the latest version (thanks for publishing it @nelsonic ), so I think this PR is ready for review now.

@nelsonic nelsonic added the priority-1 Highest priority issue. This is costing us money every minute that passes. label Nov 22, 2021
@@ -15,15 +15,15 @@
<div style="font-size: 1.2em;
overflow-wrap: break-word; font-family: monospace;
border: 1px solid black; padding: 10px; background-color: #EBEDEF;">
<%= apikey.client_id %>/<%= apikey.client_secret %>
<%= apikey.client_id %>/<%= apikey.client_secret %>/<%= @auth_url %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While reading this code I've realised that this will work fine for our two instances of the auth app. (so fine for now) but at some point we might want to store the auth_url in the DB so that if we ever need to migrate the DB or instance to a new URL we can still verify that a request is valid. 💭

"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"rbac": {:hex, :rbac, "0.5.3", "4685a341df2d8e2be831a0d4c72045feb287ca330341c6c51231738561613427", [:mix], [{:auth_plug, "~> 1.2", [hex: :auth_plug, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.8.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.2.2", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "22e499d7824dece89f92569387114e7e3cef7c637f4b9798a0de77ec14045391"},
"sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
"swoosh": {:hex, :swoosh, "1.5.0", "2be4cfc1be10f2203d1854c85b18d8c7be0321445a782efd53ef0b2b88f03ce4", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b53891359e3ddca263ece784051243de84c9244c421a0dee1bff1d52fc5ca420"},
"swoosh": {:hex, :swoosh, "1.5.2", "c246e0038367bf9ac3b66715151930a7215eb7427c242cc5206fc59fa344a7dc", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fc34b2c14afaa6e2cd92c829492536887a00ae625e404e40469926949b029605"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably exclude :swoosh until we decide to use it. 💭
But for now, happy to merge this.

@@ -13,7 +13,8 @@ defmodule Auth.Seeds do
import Ecto.Changeset

def create_admin do
if is_nil(System.get_env("TRAVIS")) && is_nil(System.get_env("HEROKU")) && is_nil(System.get_env("GITHUB_TOKEN")) do
if is_nil(System.get_env("TRAVIS")) && is_nil(System.get_env("HEROKU")) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. We can prob remove the TRAVIS check at some point. 💭

Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonLab update looks good. Thanks. 👍

@nelsonic nelsonic merged commit fd8e908 into main Nov 22, 2021
@nelsonic nelsonic deleted the auth_url-#162 branch November 22, 2021 16:14
nelsonic added a commit that referenced this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed priority-1 Highest priority issue. This is costing us money every minute that passes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants