Initial commit

This commit is contained in:
Yaser
2026-08-13 19:56:46 +03:30
commit de1d57a67b
474 changed files with 43185 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
require_dependency 'barong/jwt'
describe Barong::JWT do
let(:key) { OpenSSL::PKey::RSA.generate(2048) }
it 'should encode payload with claims' do
codec = Barong::JWT.new(key: key)
token = codec.encode({hello: 'world'})
decoded = ::JWT.decode(token, key.public_key,
true, { algorithm: 'RS256' })
expect(decoded.first.fetch('hello')).to eq('world')
end
end