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

API keys #1359

Merged
merged 30 commits into from Oct 7, 2020
Merged

API keys #1359

merged 30 commits into from Oct 7, 2020

Conversation

pfeuffer
Copy link
Member

@pfeuffer pfeuffer commented Oct 5, 2020

Proposed changes

This adds so called "API keys" aka Tokens a user can create as an alternative for his usual credentials to access the REST API and for scm client access (git, hg and svn).

The essential part of an API key is a random 20 digit passphrase. Together with the user name and an id this is packed as a json representation and encoded as a base64 string. This is presented once to the user (or as the result of the REST api call to create the key), but will be stored nowhere. Only a hashed value of this random passphrase is stored (like the normal user passwords), so that such a token can more or less be checked the same way (after extraction) a password is checked.

For this, a new realm has been added, that takes these api keys either as a bearer token or as a password for basic authentication.

API keys are limited to repositories and a specific role. Therefore they cannot be used for global configuration or user and group administration.

Your checklist for this pull request

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • PR is well described
  • Related issues linked to PR if existing and labels set
  • Target branch is not master (in most cases develop should bet the target of choice)
  • Code does not conflict with target branch
  • New code is covered with unit tests
  • CHANGELOG.md updated
  • Definition of Done's fulfilled: DoD // UI DoD
  • Documentation updated (only necessary for new features or changed behaviour)

Checklist for branch merge request (not required for forks)

@sonarcloud
Copy link

sonarcloud bot commented Oct 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

0.2% 0.2% Coverage
0.0% 0.0% Duplication

@eheimbuch eheimbuch merged commit 6eaae7b into develop Oct 7, 2020
@eheimbuch eheimbuch deleted the feature/api_keys branch October 7, 2020 06:43
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.

None yet

2 participants