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

config: added a configurable option for the expiration time of a JWT token #518

Merged
merged 1 commit into from
Oct 30, 2015

Conversation

mssola
Copy link
Collaborator

@mssola mssola commented Oct 29, 2015

See the issue #510

Signed-off-by: Miquel Sabaté Solà [email protected]

@@ -5,6 +5,8 @@ module Portus
# https://github.com/docker/distribution/blob/master/docs/spec/auth/token.md
#
class JwtToken
DEFAULT_EXPIRATION_TIME = 5.minutes
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be used only when there's no jwt_expiration_time value configured inside of the config.yml. That should not happen right?
Also this is used when the value is something wrong; in that case I would just let everything crash. That would make the issue evident.

@flavio
Copy link
Member

flavio commented Oct 29, 2015

LGTM, I not 100% convinced about having the default expiration time defined also inside of the jwt class.

@mssola
Copy link
Collaborator Author

mssola commented Oct 30, 2015

@flavio agreed. I just changed that.

flavio added a commit that referenced this pull request Oct 30, 2015
config: added a configurable option for the expiration time of a JWT token
@flavio flavio merged commit a7e73b2 into SUSE:master Oct 30, 2015
@mssola mssola deleted the jwt-expiration branch October 30, 2015 09:47
@EugenMayer
Copy link

Did has been tested @mssola ? I do export this ENV var

"PORTUS_REGISTRY_JWT_EXIRATION_TIME": "100"

but i still get a timeout after 5 minutes. Any clues? I introduced this setting in the rancher catalog questions https://github.com/EugenMayer/docker-rancher-extra-catalogs/blob/master/templates/registry-slim/17/docker-compose.yml#L43

@mssola
Copy link
Collaborator Author

mssola commented Oct 5, 2016

@EugenMayer works for me if I use: PORTUS_REGISTRY_JWT_EXPIRATION_TIME_VALUE

@EugenMayer
Copy link

@mssola why suddenly the _VALUE suffix? most of the variable do not need it? is it special

@mssola
Copy link
Collaborator Author

mssola commented Oct 5, 2016

The REGISTRY part is because of what's explained here. As for the VALUE, at least on 2.0.x releases it was already there. Maybe we could've provided this specific value directly without adding a value key ? This is something that we can certainly simplify in next releases, because right now options like machine_fqdn and registry.catalog_page also have it and it feels redundant.

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.

3 participants