summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 13:42:10 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 13:42:10 +0200
commit79f60e2b5cf388416cdc5948e19ae0401f97d353 (patch)
treeac9f72416efc4cdfdf509aa08b3608ff5a9ccc9f
parentabcc0ba57027026cb5bb074b8691510a24724958 (diff)
downloadgitlab-ce-79f60e2b5cf388416cdc5948e19ae0401f97d353.tar.gz
Move Gitlab::Auth.Result to separate file
-rw-r--r--lib/gitlab/auth.rb14
-rw-r--r--lib/gitlab/auth/result.rb17
2 files changed, 17 insertions, 14 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 1e0a7ec253a..ca2a0920c00 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -1,19 +1,5 @@
module Gitlab
module Auth
- Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
- def ci?
- type == :ci
- end
-
- def lfs_deploy_token?
- type == :lfs_deploy_token
- end
-
- def success?
- actor.present? || type == :ci
- end
- end
-
class MissingPersonalTokenError < StandardError; end
class << self
diff --git a/lib/gitlab/auth/result.rb b/lib/gitlab/auth/result.rb
new file mode 100644
index 00000000000..e4786b12676
--- /dev/null
+++ b/lib/gitlab/auth/result.rb
@@ -0,0 +1,17 @@
+module Gitlab
+ module Auth
+ Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
+ def ci?
+ type == :ci
+ end
+
+ def lfs_deploy_token?
+ type == :lfs_deploy_token
+ end
+
+ def success?
+ actor.present? || type == :ci
+ end
+ end
+ end
+end