Class: ApplicationCable::Channel

Inherits:
ActionCable::Channel::Base
  • Object
show all
Includes:
Logging, Gitlab::Auth::AuthFinders
Defined in:
app/channels/application_cable/channel.rb

Direct Known Subclasses

GraphqlChannel, Noteable::NotesChannel

Constant Summary

Constants included from Gitlab::Auth::AuthFinders

Gitlab::Auth::AuthFinders::DEPLOY_TOKEN_HEADER, Gitlab::Auth::AuthFinders::HEADER_TOKEN_KEYS, Gitlab::Auth::AuthFinders::JOB_TOKEN_HEADER, Gitlab::Auth::AuthFinders::JOB_TOKEN_PARAM, Gitlab::Auth::AuthFinders::PARAM_TOKEN_KEYS, Gitlab::Auth::AuthFinders::PATH_DEPENDENT_FEED_TOKEN_REGEX, Gitlab::Auth::AuthFinders::PRIVATE_TOKEN_HEADER, Gitlab::Auth::AuthFinders::PRIVATE_TOKEN_PARAM, Gitlab::Auth::AuthFinders::RUNNER_JOB_TOKEN_PARAM, Gitlab::Auth::AuthFinders::RUNNER_TOKEN_PARAM

Instance Method Summary collapse

Methods included from Gitlab::Auth::AuthFinders

#authentication_token_present?, #cluster_agent_token_from_authorization_token, #deploy_token_from_request, #find_runner_from_token, #find_user_from_access_token, #find_user_from_basic_auth_password, #find_user_from_bearer_token, #find_user_from_feed_token, #find_user_from_job_token, #find_user_from_lfs_token, #find_user_from_personal_access_token, #find_user_from_static_object_token, #find_user_from_warden, #find_user_from_web_access_token, #validate_and_save_access_token!

Instance Method Details

#authorization_scopesObject



16
17
18
# File 'app/channels/application_cable/channel.rb', line 16

def authorization_scopes
  [:api, :read_api]
end

#validate_token_scopeObject



10
11
12
13
14
# File 'app/channels/application_cable/channel.rb', line 10

def validate_token_scope
  validate_and_save_access_token!(scopes: authorization_scopes)
rescue Gitlab::Auth::AuthenticationError
  reject
end