-
Notifications
You must be signed in to change notification settings - Fork 8
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
1292 add api key #1293
1292 add api key #1293
Conversation
Why? One could want to have different API keys for different applications. |
API-Keys are user-based not application-based. Technically there is no reason to not allow multiple API-Keys, but this assumes that users can handle their keys correctly. |
The code looks good. I still need to play around with the new feature. Now I don't have time, though. Maybe later today or tomorrow in the morning. |
private | ||
def initialize_key | ||
generate_key! unless key | ||
set_status! unless status |
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 we still have status
Also renames set_status! method to set_valid! and uses the valid-scope in its own methods.
e672cd8
to
936099b
Compare
👍 |
Shall close #1292.
Adds API-Keys to the application. Every user can create API-Keys. Only one per user will be valid at any given time. Currently the invalid ones will also be stored indefinitely - we might want to change this later on.
Also adds 'current_user' handling based on the api-key for the API-Controller. Tests for this part will however have to wait until the first feature is implemented, that actually needs authentication (which will probably be #1156).