(tx *storage.Connection, dbEncryption conf.DatabaseEncryptionConfiguration)
| 180 | } |
| 181 | |
| 182 | func (s *Session) ReEncryptRefreshTokenHmacKey(tx *storage.Connection, dbEncryption conf.DatabaseEncryptionConfiguration) error { |
| 183 | key, _, err := s.GetRefreshTokenHmacKey(dbEncryption) |
| 184 | if err != nil { |
| 185 | return err |
| 186 | } |
| 187 | |
| 188 | es, err := crypto.NewEncryptedString(s.ID.String(), []byte(base64.RawURLEncoding.EncodeToString(key)), dbEncryption.EncryptionKeyID, dbEncryption.EncryptionKey) |
| 189 | if err != nil { |
| 190 | return err |
| 191 | } |
| 192 | |
| 193 | encryptedValue := es.String() |
| 194 | s.RefreshTokenHmacKey = &encryptedValue |
| 195 | |
| 196 | return tx.UpdateOnly(s, "refresh_token_hmac_key") |
| 197 | } |
| 198 | |
| 199 | type SessionValidityReason = int |
| 200 |
no test coverage detected