Module: AuthServlet

Defined in:
lib/msf/core/web_services/servlet/auth_servlet.rb

Class Method Summary collapse

Class Method Details

.api_account_pathObject



7
8
9
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 7

def self.
  "#{AuthServlet.api_path}/account"
end

.api_generate_token_pathObject



19
20
21
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 19

def self.api_generate_token_path
  "#{AuthServlet.api_path}/generate-token"
end

.api_login_pathObject



11
12
13
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 11

def self.
  "#{AuthServlet.api_path}/login"
end

.api_logout_pathObject



15
16
17
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 15

def self.api_logout_path
  "#{AuthServlet.api_path}/logout"
end

.api_pathObject



3
4
5
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 3

def self.api_path
  '/api/v1/auth'
end

.api_unauthenticated_pathObject



23
24
25
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 23

def self.api_unauthenticated_path
  "#{AuthServlet.api_path}/unauthenticated"
end

.registered(app) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/msf/core/web_services/servlet/auth_servlet.rb', line 27

def self.registered(app)
  app.get AuthServlet., &

  app.get AuthServlet., &
  app.post AuthServlet., &

  app.get AuthServlet.api_logout_path, &get_logout
  app.post AuthServlet.api_generate_token_path, &post_generate_token
  app.post "#{AuthServlet.api_unauthenticated_path}/?:scope?", &post_unauthenticated
end