diff options
author | William Carroll <wpcarro@gmail.com> | 2020-02-09T17·50+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-02-10T10·06+0000 |
commit | 44dca4a18852de1cac6bffe4ab62e03433b8ee93 (patch) | |
tree | c7d6461415a572f8bb016bee9e28cd6ee72114d6 /monzo_ynab/tokens.nix | |
parent | 4ea5a1bffad0628db593b7158216113c7c1956bd (diff) |
Move authorization logic into separate package
Relocated the logic for authorizing clients into a separate package that the tokens server now depends on. Moving this helped me separate concerns. I removed a few top-level variables and tried to write more pure versions of the authorization functions to avoid leaking Monzo-specific details.
Diffstat (limited to 'monzo_ynab/tokens.nix')
-rw-r--r-- | monzo_ynab/tokens.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/monzo_ynab/tokens.nix b/monzo_ynab/tokens.nix index 6b932e3975ad..a00191a20782 100644 --- a/monzo_ynab/tokens.nix +++ b/monzo_ynab/tokens.nix @@ -4,12 +4,24 @@ ... }: -depot.buildGo.program { +let + auth = depot.buildGo.package { + name = "auth"; + srcs = [ + ./auth.go + ]; + deps = with briefcase.gopkgs; [ + utils + ]; + }; +in depot.buildGo.program { name = "token-server"; srcs = [ ./tokens.go ]; deps = with briefcase.gopkgs; [ kv + utils + auth ]; } |