Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Introduce application tokens #625

Merged
merged 1 commit into from
Dec 10, 2015
Merged

Introduce application tokens #625

merged 1 commit into from
Dec 10, 2015

Conversation

flavio
Copy link
Member

@flavio flavio commented Dec 9, 2015

Right now the Docker client stores the credentials in plain
format on the host. This is really bad from a security point of view,
especially for users using LDAP to authenticated.

This commit introduces the concept of "application tokens". Each user
can have at most 5 application tokens. The tokens are created in a
random secure way by Portus and are stored inside of its database after
being hashed via bcrypt.

The application tokens can be used by all the programs authenticating
against a Docker registry protected by Portus (e.g.: the docker cli
client). They cannot be used to log into Portus' web interface.

The application tokens can be revoked at any time by using a new UI.

Screenshots

Token management UI

new-token

Notice a new token has just been created

Token removal

tag-remove

After the token has been removed:
tag-removed

Token limit reached

This user has already 5 tokens, hence he cannot add new ones:
token-disabled

@flavio
Copy link
Member Author

flavio commented Dec 9, 2015

You can start reviewing the code, everything works fine and has been tested. However I want to write some tests using capybara.

@@ -2,6 +2,16 @@
# use in order to perform operation into the registry. This is the last step in
# the authentication process for Portus' point of view.
class Api::V2::TokensController < Api::BaseController
before_action :check_token

def check_token
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add some documentation

@mssola
Copy link
Collaborator

mssola commented Dec 9, 2015

LGTM. Just fix all my nitpicking :P

@flavio
Copy link
Member Author

flavio commented Dec 10, 2015

Now application token events are tracked too:

token-activities

@flavio
Copy link
Member Author

flavio commented Dec 10, 2015

Everything is ready to be reviewed, I'll squash all the commits into a single one before doing the merge.

@mssola
Copy link
Collaborator

mssola commented Dec 10, 2015

LGTM. Once tests are passing, just squash your commits and merge it.

Right now the Docker client stores the credentials in plain
format on the host. This is really bad from a security point of view,
especially for users using LDAP to authenticated.

This commit introduces the concept of "application tokens". Each user
can have at most 5 application tokens. The tokens are created in a
random secure way by Portus and are stored inside of its database after
being hashed via bcrypt.

The application tokens can be used by all the programs authenticating
against a Docker registry protected by Portus (e.g.: the docker cli
client). They cannot be used to log into Portus' web interface.

The application tokens can be revoked at any time by using a new UI.

Signed-off-by: Flavio Castelli <[email protected]>
@flavio flavio force-pushed the authorization-tokens branch from 637237d to b399f90 Compare December 10, 2015 13:13
flavio added a commit that referenced this pull request Dec 10, 2015
@flavio flavio merged commit be469f3 into master Dec 10, 2015
@flavio flavio deleted the authorization-tokens branch December 10, 2015 13:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants