Class: T2Server::HttpBasic

Inherits:
HttpCredentials show all
Defined in:
lib/t2-server/net/credentials.rb

Overview

A class representing HTTP Basic credentials. Use this class to authenticate operations on a Taverna Server that require it.

See also Util.strip_uri_credentials.

Instance Attribute Summary

Attributes inherited from HttpCredentials

#username

Instance Method Summary collapse

Methods inherited from HttpCredentials

#inspect, #to_s

Constructor Details

#initialize(username, password) ⇒ HttpBasic

:call-seq:

new(username, password) -> HttpBasic

Create a set of basic credentials using the supplied username and password.



88
89
90
# File 'lib/t2-server/net/credentials.rb', line 88

def initialize(username, password)
  super(username, password)
end

Instance Method Details

#authenticate(request) ⇒ Object

:stopdoc: Authenticate the supplied HTTP request with the credentials held within this class.



95
96
97
# File 'lib/t2-server/net/credentials.rb', line 95

def authenticate(request)
  request.basic_auth @username, @password
end