mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Change Base64 encoding to be url_safe, add crude implementation of a Controller
This commit is contained in:
parent
dc8230dcc2
commit
35c3f0a5bf
6 changed files with 50 additions and 7 deletions
|
@ -15,6 +15,7 @@ class AuthTokenCreatorTest < ActiveSupport::TestCase
|
|||
def test_hashable_is_constructed_as_expected
|
||||
expected_hashable = { user_ident: 'US-1234', user_username: 'Registrant User',
|
||||
expires_at: '2010-07-05 00:30:00 UTC' }.to_json
|
||||
|
||||
assert_equal(expected_hashable, @token_creator.hashable)
|
||||
end
|
||||
|
||||
|
@ -23,7 +24,7 @@ class AuthTokenCreatorTest < ActiveSupport::TestCase
|
|||
encryptor.decrypt
|
||||
encryptor.key = @random_bytes
|
||||
|
||||
base64_decoded = Base64.decode64(@token_creator.encrypted_token)
|
||||
base64_decoded = Base64.urlsafe_decode64(@token_creator.encrypted_token)
|
||||
result = encryptor.update(base64_decoded) + encryptor.final
|
||||
|
||||
hashable = { user_ident: 'US-1234', user_username: 'Registrant User',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue