Class: PersonalAccessTokensFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/personal_access_tokens_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}, current_user = nil) ⇒ PersonalAccessTokensFinder

Returns a new instance of PersonalAccessTokensFinder.



8
9
10
11
# File 'app/finders/personal_access_tokens_finder.rb', line 8

def initialize(params = {}, current_user = nil)
  @params = params
  @current_user = current_user
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'app/finders/personal_access_tokens_finder.rb', line 4

def params
  @params
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/finders/personal_access_tokens_finder.rb', line 13

def execute
  tokens = PersonalAccessToken.all
  tokens = by_current_user(tokens)
  tokens = by_user(tokens)
  tokens = by_users(tokens)
  tokens = by_impersonation(tokens)
  tokens = by_state(tokens)
  tokens = by_revoked_state(tokens)
  tokens = by_created_before(tokens)
  tokens = by_created_after(tokens)
  tokens = by_expires_before(tokens)
  tokens = by_expires_after(tokens)
  tokens = by_last_used_before(tokens)
  tokens = by_last_used_after(tokens)
  tokens = by_search(tokens)
  tokens = by_organization(tokens)
  tokens = by_group(tokens)
  tokens = tokens.allow_cross_joins_across_databases(url: "https://gitlab.com/gitlab-org/gitlab/-/issues/436657")

  by_user_types_with_in_operator_optimization(
    sort(tokens)
  )
end