diff options
author | Rémy Coutable <remy@rymai.me> | 2017-03-01 07:08:38 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-01 07:08:38 +0000 |
commit | ad00b9bc60f2204419bf21ad62c811f59ee5ead3 (patch) | |
tree | 31dd9381fafb56be5b53deb5fce8b95bdfadd07c /app | |
parent | c15028b1b87eafbb1cd9ed658e7ac8877ae4f67e (diff) | |
parent | 1872859dd49942eeacb8bfe76f1c21be7eaab6c9 (diff) | |
download | gitlab-ce-ad00b9bc60f2204419bf21ad62c811f59ee5ead3.tar.gz |
Merge branch '28808-fix-top-level-constant-referenced' into 'master'
Don't declare constants in Struct
Closes #28808
See merge request !9582
Diffstat (limited to 'app')
-rw-r--r-- | app/services/access_token_validation_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/access_token_validation_service.rb b/app/services/access_token_validation_service.rb index ddaaed90e5b..b2a543daa00 100644 --- a/app/services/access_token_validation_service.rb +++ b/app/services/access_token_validation_service.rb @@ -1,10 +1,16 @@ -AccessTokenValidationService = Struct.new(:token) do +class AccessTokenValidationService # Results: VALID = :valid EXPIRED = :expired REVOKED = :revoked INSUFFICIENT_SCOPE = :insufficient_scope + attr_reader :token + + def initialize(token) + @token = token + end + def validate(scopes: []) if token.expired? return EXPIRED |