Class: Basecamp::Oauth::RefreshRequest

Inherits:
Data
  • Object
show all
Defined in:
lib/basecamp/oauth/refresh_request.rb

Overview

Parameters for refreshing an access token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token_endpoint:, refresh_token:, client_id: nil, client_secret: nil, use_legacy_format: false, resource: nil) ⇒ RefreshRequest

Returns a new instance of RefreshRequest.



24
25
26
27
28
29
30
31
32
33
# File 'lib/basecamp/oauth/refresh_request.rb', line 24

def initialize(
  token_endpoint:,
  refresh_token:,
  client_id: nil,
  client_secret: nil,
  use_legacy_format: false,
  resource: nil
)
  super
end

Instance Attribute Details

#client_idString? (readonly)

The client identifier (optional)

Returns:

  • (String, nil)

    the current value of client_id



16
17
18
# File 'lib/basecamp/oauth/refresh_request.rb', line 16

def client_id
  @client_id
end

#client_secretString? (readonly)

The client secret (optional)

Returns:

  • (String, nil)

    the current value of client_secret



16
17
18
# File 'lib/basecamp/oauth/refresh_request.rb', line 16

def client_secret
  @client_secret
end

#refresh_tokenString (readonly)

The refresh token

Returns:

  • (String)

    the current value of refresh_token



16
17
18
# File 'lib/basecamp/oauth/refresh_request.rb', line 16

def refresh_token
  @refresh_token
end

#resourceString? (readonly)

RFC 8707 resource indicator to bind the refreshed token to, sent only when set. Echo the stored token's resource: BC5 multi-account refresh tokens hard-require it (SPEC ยง16). Appended last so earlier members keep their positions.

Returns:

  • (String, nil)

    the current value of resource



16
17
18
# File 'lib/basecamp/oauth/refresh_request.rb', line 16

def resource
  @resource
end

#token_endpointString (readonly)

URL of the token endpoint

Returns:

  • (String)

    the current value of token_endpoint



16
17
18
# File 'lib/basecamp/oauth/refresh_request.rb', line 16

def token_endpoint
  @token_endpoint
end

#use_legacy_formatBoolean (readonly)

Use Launchpad's non-standard token format

Returns:

  • (Boolean)

    the current value of use_legacy_format



16
17
18
# File 'lib/basecamp/oauth/refresh_request.rb', line 16

def use_legacy_format
  @use_legacy_format
end