Move Gitlab::Auth.Result to separate file
This commit is contained in:
parent
abcc0ba570
commit
79f60e2b5c
2 changed files with 17 additions and 14 deletions
|
@ -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
|
||||
|
|
17
lib/gitlab/auth/result.rb
Normal file
17
lib/gitlab/auth/result.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue