Class: T2Server::HttpBasic
- Inherits:
-
HttpCredentials
- Object
- HttpCredentials
- T2Server::HttpBasic
- Defined in:
- lib/t2-server/net/credentials.rb
Overview
A class representing HTTP Basic credentials.
Instance Attribute Summary
Attributes inherited from HttpCredentials
Instance Method Summary collapse
-
#authenticate(request) ⇒ Object
:call-seq: authenticate(request).
-
#initialize(username, password) ⇒ HttpBasic
constructor
Create a set of credentials with the supplied username and password.
Methods inherited from HttpCredentials
Constructor Details
#initialize(username, password) ⇒ HttpBasic
Create a set of credentials with the supplied username and password.
71 72 73 |
# File 'lib/t2-server/net/credentials.rb', line 71 def initialize(username, password) super(username, password) end |
Instance Method Details
#authenticate(request) ⇒ Object
:call-seq:
authenticate(request)
Authenticate the supplied HTTP request with the credentials held within this class.
80 81 82 |
# File 'lib/t2-server/net/credentials.rb', line 80 def authenticate(request) request.basic_auth @username, @password end |