Move Gitlab::Auth.Result to separate file
This commit is contained in:
parent
abcc0ba570
commit
79f60e2b5c
|
@ -1,19 +1,5 @@
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Auth
|
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 MissingPersonalTokenError < StandardError; end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
|
@ -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 New Issue