Store Last.fm API key with encrypted secret

This commit is contained in:
Claudio Ortolina
2025-05-06 15:18:14 +01:00
parent d5b29b20bb
commit 95f71519d3
12 changed files with 87 additions and 9 deletions
+14
View File
@@ -0,0 +1,14 @@
defmodule MusicLibrary.Secrets do
alias MusicLibrary.Repo
alias MusicLibrary.Secrets.Secret
def store(name, value) do
%Secret{}
|> Secret.changeset(%{name: name, value: value})
|> Repo.insert(on_conflict: :replace_all)
end
def get!(name) do
Repo.get!(Secret, name)
end
end