Skip to content

Commit 0e5c824

Browse files
committed
📝 Documentation updates
1 parent 16d415c commit 0e5c824

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lib/oauth2/authenticator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(id, secret, mode)
1717

1818
# Apply the request credentials used to authenticate to the Authorization Server
1919
#
20-
# Depending on configuration, this might be as request params or as an
20+
# Depending on the configuration, this might be as request params or as an
2121
# Authorization header.
2222
#
2323
# User-provided params and header take precedence.

lib/oauth2/client.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class Client # rubocop:disable Metrics/ClassLength
4343
# @option options [Logger] :logger (::Logger.new($stdout)) Logger instance for HTTP request/response output; requires OAUTH_DEBUG to be true
4444
# @option options [Class] :access_token_class (AccessToken) class to use for access tokens; you can subclass OAuth2::AccessToken, @version 2.0+
4545
# @option options [Hash] :ssl SSL options for Faraday
46+
#
4647
# @yield [builder] The Faraday connection builder
4748
def initialize(client_id, client_secret, options = {}, &block)
4849
opts = options.dup
@@ -106,6 +107,7 @@ def token_url(params = nil)
106107
# Makes a request relative to the specified site root.
107108
# Updated HTTP 1.1 specification (IETF RFC 7231) relaxed the original constraint (IETF RFC 2616),
108109
# allowing the use of relative URLs in Location headers.
110+
#
109111
# @see https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2
110112
#
111113
# @param [Symbol] verb one of :get, :post, :put, :delete
@@ -141,7 +143,7 @@ def request(verb, url, opts = {}, &block)
141143
raise(error, "Got #{response.status} status code, but no Location header was present")
142144
end
143145
when 200..299, 300..399
144-
# on non-redirecting 3xx statuses, just return the response
146+
# on non-redirecting 3xx statuses, return the response
145147
response
146148
when 400..599
147149
if opts.fetch(:raise_errors, options[:raise_errors])
@@ -164,6 +166,7 @@ def request(verb, url, opts = {}, &block)
164166
# * params can include a 'snaky' key to control snake_case conversion (default: false)
165167
# @param [Hash] access_token_opts options that will be passed to the AccessToken initialization
166168
# @param [Proc] extract_access_token (deprecated) a proc that can extract the access token from the response
169+
#
167170
# @yield [opts] The block is passed the options being used to make the request
168171
# @yieldparam [Hash] opts options being passed to the http library
169172
#
@@ -218,7 +221,8 @@ def get_token(params, access_token_opts = {}, extract_access_token = nil, &block
218221
end
219222

220223
# The HTTP Method of the request
221-
# @return [Symbol] HTTP verb, one of :get, :post, :put, :delete
224+
#
225+
# @return [Symbol] HTTP verb, one of [:get, :post, :put, :delete]
222226
def http_method
223227
http_meth = options[:token_method].to_sym
224228
return :post if http_meth == :post_with_query_string
@@ -264,7 +268,7 @@ def assertion
264268
# requesting authorization. If it is provided at authorization time it MUST
265269
# also be provided with the token exchange request.
266270
#
267-
# Providing the :redirect_uri to the OAuth2::Client instantiation will take
271+
# Providing :redirect_uri to the OAuth2::Client instantiation will take
268272
# care of managing this.
269273
#
270274
# @api semipublic
@@ -273,6 +277,7 @@ def assertion
273277
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3
274278
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.2.1
275279
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-10.6
280+
#
276281
# @return [Hash] the params to add to a request or URL
277282
def redirection_params
278283
if options[:redirect_uri]
@@ -309,7 +314,7 @@ def parse_snaky_params_headers(params)
309314
parse = params.key?(:parse) ? params.delete(:parse) : Response::DEFAULT_OPTIONS[:parse]
310315
snaky = params.key?(:snaky) ? params.delete(:snaky) : Response::DEFAULT_OPTIONS[:snaky]
311316
params = authenticator.apply(params)
312-
# authenticator may add :headers, and we remove them here
317+
# authenticator may add :headers, and we separate them from params here
313318
headers = params.delete(:headers) || {}
314319
[parse, snaky, params, headers]
315320
end

0 commit comments

Comments
 (0)