-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to use multiple keys for a single secret (#2)
The entry key concept enables to have multiple keys for a single secret. That supposed to replace the previous key concept, which was a single key for a single secret. The legacy key concept is still supported, but it is not recommended to use it and it will be removed in the future. The multiple keys concept is useful to share the same secret with multiple users, and to be able to revoke access to a single user without affecting the others. At the moment the anyone who has access to the secret can add a new key to it. - Introduced an entrykeymanager service. - entrykeymanager now returns the Key Encryption Key (KEK) for Data Encryption Key (DEK) on creation. - Added an entry key generator endpoint. - Shared parser codes have been implemented. - Introduced a common interface for views. - Implemented the view interface for entry creation. - Updated entry delete to implement the views.View interface. - Updated getentry to implement the views.View interface. - Fixed an issue with finding keys. - Refactored services to improve code organization and structure. - Moved mocks to their respective packages. - Added support for legacy encryption. - Updated remaining reads of entry keys. - Simplified test database and transaction initialization. - Renamed entrymodel.UpdateAccessed to Use. - Added a command to generate coverage. - Improved EntryKeyManager and EntryManager tests. - Added a coverage clean-up command to the Makefile. - Handled database operation errors in entrykey tests.
- Loading branch information
Showing
48 changed files
with
3,006 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Create a new entry | ||
POST {{api_host}}/api/?maxReads=3 | ||
content-type: application/json | ||
{ | ||
"name": "John Doe", | ||
"email": "[email protected]" | ||
} | ||
|
||
HTTP 200 | ||
[Captures] | ||
entry_uuid: header "x-entry-uuid" | ||
entry_key: header "x-entry-key" | ||
entry_expire: header "x-entry-expire" | ||
entry_delete_key: header "x-entry-delete-key" | ||
|
||
|
||
# Generate a new key for the entry | ||
GET {{api_host}}/api/key/{{entry_uuid}}/{{entry_key}} | ||
|
||
HTTP 200 | ||
[Captures] | ||
entry_key2: header "x-entry-key" | ||
entry_expire2: header "x-entry-expire" | ||
|
||
GET {{api_host}}/api/key/{{entry_uuid}}/{{entry_key}} | ||
|
||
HTTP 200 | ||
[Captures] | ||
entry_key3: header "x-entry-key" | ||
entry_expire3: header "x-entry-expire" | ||
|
||
# Retrieve the entry with key 2 | ||
GET {{api_host}}/api/{{entry_uuid}}/{{entry_key2}} | ||
|
||
HTTP 200 | ||
[Asserts] | ||
{ | ||
"name": "John Doe", | ||
"email": "[email protected]" | ||
} | ||
|
||
# Retrieve the entry with key 3 | ||
GET {{api_host}}/api/{{entry_uuid}}/{{entry_key3}} | ||
|
||
HTTP 200 | ||
[Asserts] | ||
{ | ||
"name": "John Doe", | ||
"email": "[email protected]" | ||
} | ||
|
||
# # Should not be able to retrieve the entry again | ||
# GET {{api_host}}/api/{{entry_uuid}}/{{entry_key2}} | ||
# | ||
# HTTP 404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,9 @@ HTTP 200 | |
"name": "John Doe", | ||
"email": "[email protected]" | ||
} | ||
|
||
|
||
# Should not be able to retrieve the entry again | ||
GET {{api_host}}/api/{{entry_uuid}}/{{entry_key}} | ||
|
||
HTTP 404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.