-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #163 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 529 529
=========================================
Hits 529 529
Continue to review full report at Codecov.
|
Once dwyl/auth_plug#37 is deployed we can try to merge this PR and test the new version |
@@ -2,6 +2,8 @@ defmodule AuthWeb.AppController do | |||
use AuthWeb, :controller | |||
alias Auth.App | |||
|
|||
@auth_url "dwylauth.herokuapp.com" |
There was a problem hiding this comment.
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
I've updated auth_plug to the latest version (thanks for publishing it @nelsonic ), so I think this PR is ready for review now. |
@@ -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 %> |
There was a problem hiding this comment.
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"}, |
There was a problem hiding this comment.
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")) && |
There was a problem hiding this comment.
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. 💭
There was a problem hiding this 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. 👍
ref: #162