Skip to content

Commit

Permalink
Freeze devise auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermoap committed Sep 28, 2023
1 parent 87545eb commit e8b8bcb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
20 changes: 10 additions & 10 deletions doc/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ paths:
required: true
schema:
type: string
example: OFtyWyx63v_WG2ch8g53Yw
example: 123456789A123456789012
- name: client
in: header
required: true
schema:
type: string
example: qJj0XFFoUvh8RBs7m31CTg
example: abcdefghijklmnopqrstuv
- name: uid
in: header
required: true
Expand Down Expand Up @@ -233,13 +233,13 @@ paths:
required: true
schema:
type: string
example: 9_b7bSAAPQCW_lIgLhY3bg
example: 123456789A123456789012
- name: client
in: header
required: true
schema:
type: string
example: i1oeaby7x8o8gfmGtpsTBw
example: abcdefghijklmnopqrstuv
- name: uid
in: header
required: true
Expand Down Expand Up @@ -304,13 +304,13 @@ paths:
required: true
schema:
type: string
example: pI1i551zDQOFu3Dzv5OP-A
example: 123456789A123456789012
- name: client
in: header
required: true
schema:
type: string
example: MG3sZ85IHKQxT9MHbt5mTQ
example: abcdefghijklmnopqrstuv
- name: uid
in: header
required: true
Expand Down Expand Up @@ -604,13 +604,13 @@ paths:
required: true
schema:
type: string
example: K6JyVP5t7mel5LxfjCahNA
example: 123456789A123456789012
- name: client
in: header
required: true
schema:
type: string
example: relAg0omfbUyqPBFVlHkow
example: abcdefghijklmnopqrstuv
- name: uid
in: header
required: true
Expand Down Expand Up @@ -734,15 +734,15 @@ paths:
in: query
schema:
type: string
example: KdB_x6wx2MnibxfnKDre
example: GhTthEdCcgpMNWHQmxfG
responses:
'302':
description: returns the client id
content:
text/html:
schema:
type: string
example: <html><body>You are being <a href="http://www.example.com:///?access-token=7DPNXDXFM2YVLHpsIn7Rcw&amp;client=XfkDrgWb7gNugcmRXxgBKA&amp;client_id=XfkDrgWb7gNugcmRXxgBKA&amp;config=&amp;expiry=1735700400&amp;reset_password=true&amp;token=7DPNXDXFM2YVLHpsIn7Rcw&amp;uid=raguel%40hauck.co">redirected</a>.</body></html>
example: <html><body>You are being <a href="http://www.example.com:///?access-token=123456789A123456789012&amp;client=abcdefghijklmnopqrstuv&amp;client_id=abcdefghijklmnopqrstuv&amp;config=&amp;expiry=1735700400&amp;reset_password=true&amp;token=123456789A123456789012&amp;uid=raguel%40hauck.co">redirected</a>.</body></html>
components:
schemas:
User:
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require 'webmock/rspec'
require 'shoulda/matchers'
require 'pundit/rspec'
require 'support/devise_token_auth_overrides' if ENV['OPENAPI']

Knapsack.tracker.config(enable_time_offset_warning: false)
Knapsack::Adapters::RSpecAdapter.bind
Expand Down
14 changes: 14 additions & 0 deletions spec/support/devise_token_auth_overrides.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module DeviseTokenAuth
module TokenFactory
def self.create(client: nil, lifespan: nil, cost: nil)
obj_client = 'abcdefghijklmnopqrstuv'
obj_token = '123456789A123456789012'
obj_token_hash = token_hash(obj_token, cost)
obj_expiry = expiry(lifespan)

Token.new(obj_client, obj_token, obj_token_hash, obj_expiry)
end
end
end

0 comments on commit e8b8bcb

Please sign in to comment.