dwyl / dwyl/auth

Discuss: Change format of `AUTH_API_KEY` so `URL` is first

Open
#436 0 comments 0 reactions 0 assignees View on GitHub
discuss elixir enhancement priority-2 T5m tech-debt technical
Dominant language
Elixir
Stars
141
Forks
8
PR merge metrics
No merged PRs in 30d

Description

While working on the `get_baseurl_from_auth_api_key/0` function in https://github.com/dwyl/auth_plug/issues/214
I was reminded of the format of the `AUTH_API_KEY` is:

```sh
"2cfxNb3PwJuibpFGfZLFRxw3B18oykn4PiJMinv4L1D/2cfxNarsZzzwNzy9B49417bueRp9D5st/authdemo.fly.dev"
```

And it got me thinking _why_ did we/I put the URL after the public/private keys?
Wouldn't it make more sense to have it as:

```sh
"authdemo.fly.dev/2cfxNb3PwJuibpFGfZLFRxw3B18oykn4PiJMinv4L1D/2cfxNarsZzzwNzy9B49417bueRp9D5st"
```

And we could then make this URL _valid_ and render the `/app`.
I don't see a reason _not_ to, other than introducing a **breaking change**.
But given that the rebuild will be total and require new keys for all apps we should consider it. 💭

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the get_baseurl_from_auth_api_key/0 function referenced in the linked auth_plug issue, then trace how AUTH_API_KEY values are generated and consumed. Compare the existing and proposed URL-first formats, including the breaking-change and new-key implications; done means the format decision and migration requirements are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.