summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-28 13:34:06 +0100
committerRémy Coutable <remy@rymai.me>2017-02-28 17:50:22 +0100
commit1872859dd49942eeacb8bfe76f1c21be7eaab6c9 (patch)
treee21c6a957997d8d6c4f1fe46709ac8df6158330b /app/services
parenta69aa3dad51d5e881b3c92f3ac09c689edc00ab3 (diff)
downloadgitlab-ce-1872859dd49942eeacb8bfe76f1c21be7eaab6c9.tar.gz
Don't declare constants in Struct28808-fix-top-level-constant-referenced
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/services')
-rw-r--r--app/services/access_token_validation_service.rb8
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