-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Keystore interface #496
Extend Keystore interface #496
Conversation
Add methods GetClientIDEncryptionKey and GetZoneIDEncryptionKey that should return only the latest key that will be used to encrypt data by client / in zone. By default, it will simply request all keys and take the latest one, so no performance improvements until these methods are properly implemented in different keystores.
Use `go generate ./...` to generate newer mock interface implementations in `keystore/mocks` so they will include new keystore methods. Fix some tests where the new methods were missing as well.
…tend-keystore-interface
After recent re-generation of some files, more golint issues were introduced so had to increase allowed number, it's not related to changes done in code.
Introduce new function `getLatestSymmetricKey`, similar to `getSymmetricKeys` that will only read one key, use it in methods implementation
GetClientIDEncryptionKey -> GetClientIDSymmetricKey GetZoneIDEncryptionKey -> GetZoneIDSymmetricKey
…tend-keystore-interface
Extend `RecordProcessorKeyStore` and `PoisonKeyStore` with new nethod: GetPoisonSymmetricKey() ([]byte, error) and implement it in keystores v1/v2. Use this function in `Get*IDSymmetricKey` of poison keystore. Comment unused function `NewRecordProcessor` that caused compilation issues. Re-generate some mock files again.
// If a poison record does not exist, it is created and its sole symmetric key is returned. | ||
func (store *KeyStore) GetPoisonSymmetricKey() ([]byte, error) { | ||
keyFileName := getSymmetricKeyName(PoisonKeyFilename) | ||
poisonKeyExists, err := store.fs.Exists(store.GetPrivateKeyFilePath(keyFileName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my last comment was related to this block
#496 (comment)
// Try getting it from cache first | ||
key, ok := store.cache.Get(keyFileName) | ||
if ok { | ||
return key, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is it's encrypted unuseful key. we should decrypt it. and add test if your tests passed it )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge after successful test run
Add methods
GetClientIDSymmetricKey
andGetZoneIDSymmetricKey
that should return only the latest key that will be used to encrypt data by client / in zone.Implemented new methods for filesystem keystore v1 and v2 (but no special impl for poison keys).
This should cover Redis as well.
Checklist
Public API has proper documentation in the Acra documentation site or has PR on documentation repositorywith new changes
CHANGELOG.md is updated (in case of notable or breaking changes)Benchmark results are attached (if applicable)Example projects and code samples are up-to-date (in case of API changes)