Skip to content

Commit

Permalink
feat: auth ruby (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 authored Dec 9, 2024
1 parent e4e5199 commit 7635646
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 1,500 deletions.
3 changes: 2 additions & 1 deletion lib/twilio-ruby/auth_strategy/token_auth_strategy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative 'auth_strategy'
require_relative './../credential/auth_type'
require 'jwt'
module Twilio
module REST
class TokenAuthStrategy < AuthStrategy
Expand All @@ -25,7 +26,7 @@ def fetch_token
end

def token_expired?
decoded_token = JWT.decode(@token, nil, false)
decoded_token = ::JWT.decode(@token, nil, false)
exp = decoded_token[0]['exp']
Time.at(exp) < Time.now
end
Expand Down
1 change: 1 addition & 0 deletions lib/twilio-ruby/framework/rest/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def process_response(response)
end

def load_page(payload)
return payload['Resources'] if payload['Resources']
if payload['meta'] && payload['meta']['key']
return payload[payload['meta']['key']]
else
Expand Down
49 changes: 0 additions & 49 deletions lib/twilio-ruby/rest/preview_iam/versionless.rb

This file was deleted.

273 changes: 0 additions & 273 deletions lib/twilio-ruby/rest/preview_iam/versionless/organization.rb

This file was deleted.

Loading

0 comments on commit 7635646

Please sign in to comment.