Class: JSONRPC2::BasicAuth
- Defined in:
- lib/jsonrpc2/auth.rb
Overview
HTTP Basic authentication implementation
Instance Method Summary collapse
-
#browser_check(env) ⇒ true
Checks that the browser is authorised to access the API (used by HTML API introspection).
-
#client_check(env, rpc) ⇒ true
Checks that the client is authorised to access the API.
-
#initialize(users = nil) {|user, pass| ... } ⇒ BasicAuth
constructor
Create a BasicAuth object.
Methods inherited from Auth
Constructor Details
#initialize(users = nil) {|user, pass| ... } ⇒ BasicAuth
Create a BasicAuth object
56 57 58 |
# File 'lib/jsonrpc2/auth.rb', line 56 def initialize(users=nil, &block) @users, @lookup = users, block end |
Instance Method Details
#browser_check(env) ⇒ true
Checks that the browser is authorised to access the API (used by HTML API introspection)
73 74 75 |
# File 'lib/jsonrpc2/auth.rb', line 73 def browser_check(env) valid?(env) or throw_401 end |
#client_check(env, rpc) ⇒ true
Checks that the client is authorised to access the API
65 66 67 |
# File 'lib/jsonrpc2/auth.rb', line 65 def client_check(env, rpc) browser_check(env) end |