Changed API deletion to instead set key as inactive #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Github Issue
49
What Are We Doing Here?
This PR implements #49 as described. API keys are no longer deleted but put into an inactive state. An inactive API key exists but cannot be used to authorize or authenticate any permissions. In addition there is a third state, migrated, to track API keys which have been migrated.
Existing API keys are grandfathered in as active.
How to Test and Verify
Check out this PR
Create an API key:
Verify the API key is working:
Delete the API key:
Verify the API key is inactive:
6: Verify the API can no longer authenticate:
Risk
Most the risk involves backwards compatibility. If there is an issue with backwards compatibility then existing API keys may not be able to access Emo.
Level
Medium
Required Testing
Manual
Risk Summary
In my opinion the riskiest area is the interplay between migrating and invalidating keys. Although I've tested this in detail I'd recommend a close review of the code to migrate API keys and then lookup API keys by internal ID: here and here.
Code Review Checklist
build and run.
we inevitably come back to this code it will only take hours to figure out, not
days.
a victim of rampaging consistency, and should be using this course of action.
We don't have coding standards out yet for this project, so please make sure to address any feedback regarding STYLE so the codebase remains consistent.