Skip to content

Commit e406727

Browse files
Adds Rotating Refresh Token type to Device Credentials (#275)
Co-authored-by: David Patrick <[email protected]>
1 parent 6cf30cc commit e406727

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/auth0/api/v2/device_credentials.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module DeviceCredentials
1212
# * :fields [string] A comma separated list of fields to include or exclude from the result.
1313
# * :include_fields [boolean] True if the fields specified are to be included in the result, false otherwise.
1414
# * :user_id [string] The user_id of the devices to retrieve.
15-
# * :type [string] The type of credentials. Possible values: 'public_key' or 'refresh_token'.
15+
# * :type [string] Type of credentials to retrieve. Must be 'public_key', 'refresh_token' or 'rotating_refresh_token'
1616
#
1717
# @return [json] Returns the list of existing devices for the specified client_id.
1818
# rubocop:disable Metrics/AbcSize
@@ -25,8 +25,8 @@ def device_credentials(client_id, options = {})
2525
type: options.fetch(:type, nil)
2626
}
2727
raise Auth0::InvalidParameter, 'Must supply a valid client_id' if client_id.to_s.empty?
28-
if !request_params[:type].nil? && !%w(public_key refresh_token).include?(request_params[:type])
29-
raise Auth0::InvalidParameter, 'Type must be one of \'public_key\', \'refresh_token\''
28+
if !request_params[:type].nil? && !%w(public_key refresh_token rotating_refresh_token).include?(request_params[:type])
29+
raise Auth0::InvalidParameter, 'Type must be one of \'public_key\', \'refresh_token\', \'rotating_refresh_token\''
3030
end
3131
get(device_credentials_path, request_params)
3232
end

spec/lib/auth0/api/v2/device_credentials_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
)
2323
expect { @instance.device_credentials(client_id) }.not_to raise_error
2424
end
25-
it 'is expect to raise an error when type is not one of \'public_key\', \'refresh_token\'' do
25+
it 'is expect to raise an error when type is not one of \'public_key\', \'refresh_token\', \'rotating_refresh_token\'' do
2626
expect { @instance.device_credentials(client_id, type: 'invalid_type') }.to raise_error(
27-
'Type must be one of \'public_key\', \'refresh_token\''
27+
'Type must be one of \'public_key\', \'refresh_token\', \'rotating_refresh_token\''
2828
)
2929
end
3030
end

0 commit comments

Comments
 (0)