Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
ruby: [2.5, 2.6, 2.7, 3.0]
exclude:
- os: windows-latest
ruby: 3.0
ruby: [2.5, 2.6, 2.7, 3.0, 3.1]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions lib/vonage/jwt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# frozen_string_literal: true
require 'securerandom'
require 'openssl'
require 'nexmo-jwt'
require 'vonage-jwt'

module Vonage
class JWT
Expand All @@ -15,7 +15,7 @@ class JWT
# attribute on the client object.
#
# Documentation for the Vonage Ruby JWT generator gem can be found at
# https://www.rubydoc.info/github/Nexmo/nexmo-jwt-ruby
# https://www.rubydoc.info/github/Vonage/vonage-jwt-ruby
#
# @example
# claims = {
Expand All @@ -37,7 +37,7 @@ def self.generate(payload, private_key = nil)
raise "Expecting 'private_key' in either the payload or as a separate parameter" if !payload[:private_key] && !private_key

payload[:private_key] = private_key if private_key && !payload[:private_key]
@token = Nexmo::JWTBuilder.new(payload).jwt.generate
@token = Vonage::JWTBuilder.new(payload).jwt.generate
end
end
end
2 changes: 1 addition & 1 deletion test/vonage/jwt_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def uuid_pattern
end

def sample_token
'eyJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE1OTUyNTM2MTMsImp0aSI6ImU1QmxGeDVOek5ydCIsImV4cCI6MTU5NTI1NDUxMywic3ViIjoiU3ViamVjdCIsImFwcGxpY2F0aW9uX2lkIjoieHh4eHh4eHgteHh4eC14eHh4LXh4eHgteHh4eHh4eHh4eHh4IiwidHlwIjoiSldUIn0.wQ_WHt4ba2nDWN-ju7D8VdGg6JdpVdcU2-bzvS_CMg_KVxaaD8NoYDMnIdrf4f4mOJThnmDiWvGOLFSmyqTtgN_qniCsoSL0ZnLFhvb1HWbSYsmNlOb8ePB0AkvQM-wcfHOfgToXU5tCe3OXV5s7sUDRlFEKAS4s8qzdTUAoJw5I2-RjVP9hlumV0Cda1yFyOiM1ppsV09OxbeXqKU_NLFm8XNqe_bIlB2d2XIuwtfluGXjsgPM8R2stF_hS0Q65oILue0Yru1N-IbemvLmh8Rs4hSfEKQrmabRIMOvfXdQAVTW_0g1OsGRRUsT8RAwDdcC1LB_CrktYP_o3Pp9qxA'
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE1OTUyNTM2MTMsImp0aSI6ImU1QmxGeDVOek5ydCIsImV4cCI6MTU5NTI1NDUxMywic3ViIjoiU3ViamVjdCIsImFwcGxpY2F0aW9uX2lkIjoieHh4eHh4eHgteHh4eC14eHh4LXh4eHgteHh4eHh4eHh4eHh4In0.Jv1flw0dzDEskyEHaK1appNUEHF2zBRJw0VWjQ8ri-MzsWguPu8ofoGVfWDTemF2xj87ukgfg8a3kTOjA0rZfCMUG4vJiGrWPJvCab7ECvy0_-vJgsDSzrG7I5MsBpbJnc1iyxv1kRu_U-EcbOceaM77yqisRLFSmwkEYuLFAOMuFeBOHZTbHYLhWYvzCOZXIU0IxDNQfGw-wXxXSMcv8aAPvhJe7bYZeRUpX8Pw0y2Qz0PxE7tB2ven_6-F_5FuOl2ARGU90GpzLho77aV5KQAKsaShwA4oqH5ETJF5JUDc9MYky-7Hbu2BmC3AqnpxGNnu7g4M6nnM-g63_5WFFg'
end

def decode(token)
Expand Down
2 changes: 1 addition & 1 deletion vonage.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.summary = 'This is the Ruby Server SDK for Vonage APIs. To use it you\'ll need a Vonage account. Sign up for free at https://www.vonage.com'
s.files = Dir.glob('lib/**/*.rb') + %w(LICENSE.txt README.md vonage.gemspec)
s.required_ruby_version = '>= 2.5.0'
s.add_dependency('nexmo-jwt', '~> 0.1.2')
s.add_dependency('vonage-jwt', '~> 0.1.0')
s.add_dependency('zeitwerk', '~> 2', '>= 2.2')
s.add_dependency('sorbet-runtime', '~> 0.5')
s.add_runtime_dependency('rexml')
Expand Down