Class: JIRA::JwtClient::JwtUriBuilder
- Inherits:
-
Object
- Object
- JIRA::JwtClient::JwtUriBuilder
- Defined in:
- lib/jira/jwt_client.rb
Instance Attribute Summary collapse
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#request_url ⇒ Object
readonly
Returns the value of attribute request_url.
-
#shared_secret ⇒ Object
readonly
Returns the value of attribute shared_secret.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(request_url, http_method, shared_secret, site, issuer) ⇒ JwtUriBuilder
constructor
A new instance of JwtUriBuilder.
Constructor Details
#initialize(request_url, http_method, shared_secret, site, issuer) ⇒ JwtUriBuilder
Returns a new instance of JwtUriBuilder.
20 21 22 23 24 25 26 |
# File 'lib/jira/jwt_client.rb', line 20 def initialize(request_url, http_method, shared_secret, site, issuer) @request_url = request_url @http_method = http_method @shared_secret = shared_secret @site = site @issuer = issuer end |
Instance Attribute Details
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
18 19 20 |
# File 'lib/jira/jwt_client.rb', line 18 def http_method @http_method end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
18 19 20 |
# File 'lib/jira/jwt_client.rb', line 18 def issuer @issuer end |
#request_url ⇒ Object (readonly)
Returns the value of attribute request_url.
18 19 20 |
# File 'lib/jira/jwt_client.rb', line 18 def request_url @request_url end |
#shared_secret ⇒ Object (readonly)
Returns the value of attribute shared_secret.
18 19 20 |
# File 'lib/jira/jwt_client.rb', line 18 def shared_secret @shared_secret end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
18 19 20 |
# File 'lib/jira/jwt_client.rb', line 18 def site @site end |
Instance Method Details
#build ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/jira/jwt_client.rb', line 28 def build uri = URI.parse(request_url) new_query = URI.decode_www_form(String(uri.query)) << ['jwt', jwt_header] uri.query = URI.encode_www_form(new_query) return uri.to_s unless uri.is_a?(URI::HTTP) uri.request_uri end |