Skip to content
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

Merged
merged 11 commits into from
Apr 3, 2015
Merged

1292 add api key #1293

merged 11 commits into from
Apr 3, 2015

Conversation

0robustus1
Copy link
Contributor

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).

@eugenk
Copy link
Member

eugenk commented Mar 30, 2015

Only one per user will be valid at any given time.

Why? One could want to have different API keys for different applications.

@0robustus1
Copy link
Contributor Author

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.
Later on Ontohub will probably also support OAuth (which is actually application-based).

@eugenk
Copy link
Member

eugenk commented Mar 30, 2015

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
Copy link
Member

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

@eugenk
Copy link
Member

eugenk commented Apr 1, 2015

👍

0robustus1 added a commit that referenced this pull request Apr 3, 2015
@0robustus1 0robustus1 merged commit afbccc6 into staging Apr 3, 2015
@0robustus1 0robustus1 deleted the 1292-add_api_key branch April 3, 2015 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API-Key
2 participants