Repository: cossacklabs/acra (language: python)

Issue:
Ignore legacy keys when caching keys on startup
When AcraServer/AcraTranslator starts and loads all the keys into cache (if the option is enabled), ignore old keys related to AcraConnector.
Add new key kind "legacy" and ignore this key if found inside keystore.

<!-- Describe your changes here -->

## Checklist

- [x] Change is covered by automated tests
- [x] The [coding guidelines] are followed
- [x] ~Public API has proper documentation in the [Acra documentation] site or has PR on [documentation repository] 
  with new changes~
- [x] CHANGELOG.md is updated (in case of notable or breaking changes)
- [x] ~CHANGELOG_DEV.md is updated~
- [x] ~Benchmark results are attached (if applicable)~
- [x] ~[Example projects and code samples] are up-to-date (in case of API changes)~

[coding guidelines]: https://golang.org/doc/effective_go
[Example projects and code samples]: https://github.com/cossacklabs/acra-engineering-demo
[Acra documentation]: https://docs.cossacklabs.com/
[documentation repository]: https://github.com/cossacklabs/product-docs


Discussion / hints:
TODO: 
* add integration tests that checks that acra works correctly with old keys and logs about existing legacy keys.

Fix patch:
diff --git a/keystore/filesystem/server_keystore.go b/keystore/filesystem/server_keystore.go
index 4b9b6285c..ae8878dad 100644
--- a/keystore/filesystem/server_keystore.go
+++ b/keystore/filesystem/server_keystore.go
@@ -57,6 +57,7 @@ const (
 	poisonPrivateKey   = "poison_key"
 	poisonPublicKey    = "poison_key.pub"
 	poisonSymmetricKey = "poison_key_sym"
+	legacyWebConfigKey = "auth_key"
 )
 
 // ErrUnrecognizedKeyPurpose describe key mismatch error
@@ -836,6 +837,11 @@ func (store *KeyStore) DescribeKeyFile(fileInfo os.FileInfo) (*keystore.KeyDescr
 			ID:      poisonSymmetricKey,
 			Purpose: PurposePoisonRecordSymmetricKey,
 		}, nil
+	case legacyWebConfigKey:
+		return &keystore.KeyDescription{
+			ID:      fileInfo.Name(),
+			Purpose: PurposeLegacy,
+		}, nil
 	}
 
 	components := strings.Split(fileInfo.Name(), "_")


Test patch:
diff --git a/tests/test.py b/tests/test.py
index a607047b8..333182810 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -6184,6 +6184,7 @@ class TestAcraIgnoresLegacyKeys(AcraCatchLogsMixin, BaseTestCase):
     """
 
     legacy_key_files = [
+        'auth_key',
         'testclientid',
         'testclientid.pub',
         'testclientid_server',