feat: Add ip_address to API keys (#2580)

Fixes #2561.
This commit is contained in:
Kyle Carberry
2022-06-22 17:32:21 +00:00
committed by GitHub
parent caf9c41a9e
commit b7eeb436ad
13 changed files with 144 additions and 49 deletions
+6 -4
View File
@@ -175,8 +175,9 @@ func TestPostLogin(t *testing.T) {
require.NoError(t, err, "fetch api key")
err = api.Database.UpdateAPIKeyByID(ctx, database.UpdateAPIKeyByIDParams{
ID: apiKey.ID,
LastUsed: apiKey.LastUsed,
ID: apiKey.ID,
LastUsed: apiKey.LastUsed,
IPAddress: apiKey.IPAddress,
// This should cause a refresh
ExpiresAt: apiKey.ExpiresAt.Add(time.Hour * -2),
OAuthAccessToken: apiKey.OAuthAccessToken,
@@ -207,8 +208,9 @@ func TestPostLogin(t *testing.T) {
require.NoError(t, err, "fetch login key")
err = api.Database.UpdateAPIKeyByID(ctx, database.UpdateAPIKeyByIDParams{
ID: apiKey.ID,
LastUsed: apiKey.LastUsed,
ID: apiKey.ID,
LastUsed: apiKey.LastUsed,
IPAddress: apiKey.IPAddress,
// This should cause a refresh
ExpiresAt: apiKey.ExpiresAt.Add(time.Hour * -2),
OAuthAccessToken: apiKey.OAuthAccessToken,