@@ -5,7 +5,7 @@ module JIRA
5
5
#
6
6
# == OAuth 2.0 Overview
7
7
#
8
- # OAuth 2.0 sepearates the roles of Resource Server and Authentication Server.
8
+ # OAuth 2.0 separates the roles of Resource Server and Authentication Server.
9
9
#
10
10
# The Resource Server will be Jira.
11
11
# The Authentication Server can be Jira or some other OAuth 2.0 Authentication server.
@@ -94,12 +94,16 @@ module JIRA
94
94
# @return [String] The CLIENT ID registered with the Authentication Server
95
95
# @!attribute [r] client_secret
96
96
# @return [String] The CLIENT SECRET registered with the Authentication Server
97
- # @!attribute [r] cstf_state
97
+ # @!attribute [r] csrf_state
98
98
# @return [String] An unpredictable value which a CSRF forger would not be able to provide
99
99
# @!attribute [r] oauth2_client
100
100
# @return [OAuth2::Client] The oauth2 gem client object used.
101
- # @!attribute [r] options
101
+ # @!attribute [r] oauth2_client_options
102
102
# @return [Hash] The oauth2 gem options for the client object.
103
+ # @!attribute [r] prior_grant_type
104
+ # @return [String] The grant type used to create the current Access Token.
105
+ # @!attribute [r] access_token
106
+ # @return [OAuth2::AccessToken] An object for the Access Token.
103
107
#
104
108
class Oauth2Client < RequestClient
105
109
@@ -117,26 +121,36 @@ class Oauth2Client < RequestClient
117
121
} . freeze
118
122
119
123
attr_reader :prior_grant_type , :access_token
120
- # attr_reader :options
121
124
attr_reader :oauth2_client_options , :client_id , :client_secret , :csrf_state
125
+ # attr_reader :options
122
126
123
- # @param [Hash] options
124
- # @option options [String] :client_id The registered client id
125
- # @option options [String] :client_secret The registered client secret
126
- # @option options [String] :site The hostname of the Authentication Server
127
- # @option options [String] :authorize_url The Authorization Request URI (default '/rest/oauth2/latest/authorize')
128
- # @option options [String] :token_url The Jira Resource Server Access Request URI (default '/rest/oauth2/latest/token')
129
- # @option options [String] :auth_scheme Way of passing parameters for authentication (default 'request_body')
127
+ # @param [Hash] options Options as passed from JIRA::Client constructor.
128
+ # @option options [String] :site The hostname of the Jira in the role as Resource Server
129
+ # @option options [String] :auth_site The hostname of the Authentication Server
130
+ # @option options [String] :client_id The OAuth 2.0 client id as registered with the Authentication Server
131
+ # @option options [String] :client_secret The OAuth 2.0 client secret as registered with the Authentication Server
132
+ # @option options [String] :auth_scheme Way of passing parameters for authentication (defaults to 'request_body')
133
+ # @option options [String] :authorize_url The Authorization Request URI (defaults to '/rest/oauth2/latest/authorize')
134
+ # @option options [String] :token_url The Jira Resource Server Access Request URI (defaults to '/rest/oauth2/latest/token')
130
135
# @option options [String] :redirect_uri Callback for result of Authentication Request
136
+ # @option options [Integer] :max_redirects Number of redirects allowed
137
+ # @option options [Hash] :default_headers Additional headers for requests
138
+ # @option options [Boolean] :use_ssl true if using HTTPS, false for HTTP
139
+ # @option options [Integer] :ssl_verify_mode OpenSSL::SSL::VERIFY_PEER or OpenSSL::SSL::VERIFY_NONE
140
+ # @option options [String] :cert_path Full path to certificate verifying server identity.
141
+ # @option options [String] :ssl_client_cert Path to client public key certificate.
142
+ # @option options [String] :ssl_client_key Path to client private key.
143
+ # @option options [Symbol] :ssl_version Version of TLS or SSL, (e.g. :TLSv1_2)
131
144
# @option options [String] :proxy_uri Proxy URI
132
145
# @option options [String] :proxy_user Proxy user
133
146
# @option options [String] :proxy_password Proxy Password
134
- def initialize ( options = { } )
147
+ def initialize ( options )
135
148
# @options = init_oauth2_options(options)
136
149
init_oauth2_options ( options )
137
150
if options . has_key? ( :access_token_options )
138
151
@access_token = access_token_from_options ( options [ :access_token_options ] )
139
152
end
153
+ nil
140
154
end
141
155
142
156
# @private
0 commit comments