diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2022-11-25 23:44:55 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-25 23:44:55 +1100 |
| commit | 3e4ac7821d51ac447bb39e7e1ea3c385dc3084d9 (patch) | |
| tree | 69594576856eb8b587158d9245f70aff4fec429a /internal/storage/sql_provider_queries.go | |
| parent | 3c291b5685212813f98f365c8d963e0f107860cb (diff) | |
refactor: remove pre1 migration path (#4356)
This removes pre1 migrations and improves a lot of tooling.
Diffstat (limited to 'internal/storage/sql_provider_queries.go')
| -rw-r--r-- | internal/storage/sql_provider_queries.go | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/internal/storage/sql_provider_queries.go b/internal/storage/sql_provider_queries.go index 327ab546f..f062f8afb 100644 --- a/internal/storage/sql_provider_queries.go +++ b/internal/storage/sql_provider_queries.go @@ -83,18 +83,16 @@ const ( LIMIT ? OFFSET ?;` + queryFmtSelectTOTPConfigurationsEncryptedData = ` + SELECT id, secret + FROM %s;` + //nolint:gosec // These are not hardcoded credentials it's a query to obtain credentials. queryFmtUpdateTOTPConfigurationSecret = ` UPDATE %s SET secret = ? WHERE id = ?;` - //nolint:gosec // These are not hardcoded credentials it's a query to obtain credentials. - queryFmtUpdateTOTPConfigurationSecretByUsername = ` - UPDATE %s - SET secret = ? - WHERE username = ?;` - queryFmtUpsertTOTPConfiguration = ` REPLACE INTO %s (created_at, last_used_at, username, issuer, algorithm, digits, period, secret) VALUES (?, ?, ?, ?, ?, ?, ?, ?);` @@ -127,6 +125,10 @@ const ( LIMIT ? OFFSET ?;` + queryFmtSelectWebauthnDevicesEncryptedData = ` + SELECT id, public_key + FROM %s;` + queryFmtSelectWebauthnDevicesByUsername = ` SELECT id, created_at, last_used_at, rpid, username, description, kid, public_key, attestation_type, transport, aaguid, sign_count, clone_warning FROM %s @@ -137,11 +139,6 @@ const ( SET public_key = ? WHERE id = ?;` - queryFmtUpdateUpdateWebauthnDevicePublicKeyByUsername = ` - UPDATE %s - SET public_key = ? - WHERE username = ? AND kid = ?;` - queryFmtUpdateWebauthnDeviceRecordSignIn = ` UPDATE %s SET @@ -265,6 +262,11 @@ const ( SET subject = ? WHERE id = ?;` + queryFmtUpdateOAuth2ConsentSessionSessionData = ` + UPDATE %s + SET session_data = ? + WHERE id = ?;` + queryFmtUpdateOAuth2ConsentSessionResponse = ` UPDATE %s SET authorized = ?, responded_at = CURRENT_TIMESTAMP, granted_scopes = ?, granted_audience = ?, preconfiguration = ? @@ -282,6 +284,10 @@ const ( FROM %s WHERE signature = ? AND revoked = FALSE;` + queryFmtSelectOAuth2SessionEncryptedData = ` + SELECT id, session_data + FROM %s;` + queryFmtInsertOAuth2Session = ` INSERT INTO %s (challenge_id, request_id, client_id, signature, subject, requested_at, requested_scopes, granted_scopes, requested_audience, granted_audience, |
