bannable / paseto Goto Github PK
View Code? Open in Web Editor NEWRuby implementation of PASETO tokens
License: MIT License
Ruby implementation of PASETO tokens
License: MIT License
From the spec:
Builders and Parsers SHOULD, by default, include an
exp
claim if the user did not specify an expiration time. Users MUST have some means of explicitly declaring non-expiring tokens.The recommended default expiration time is 1 hour.
and
The default values for
iat
andnbf
(if included in the list of default claims by the library, and not overriden or opted out by the user) MUST be the current time.
Proposed set of default registered claims:
exp
nbf
iat
iss
-> make mandatory via configuration?Decoding a Token does not return the footer value which is necessary for proper PASERK support.
Current behavior:
irb(main):001:0> crypt = Paseto::V4::Local.generate
=> #...
irb(main):002:0> message = {"foo" => "bar"}
=> {"foo"=>"bar"}
irb(main):003:0> footer = {"some" => "val"}
=> {"some"=>"val"}
irb(main):014:0> token = crypt.encode(payload: message, footer: MultiJson.dump(footer))
# => v4.local.jTh2jNDVDEorc76BmXHcyo5H2XuJUs0WZ_VI4hAHMkPI9RCc3bO5I0QK9aky8XYHVAOqtUF11djUgr9PEMFb8jdFrznCiuiNn9lBL9Q.eyJzb21lIjoidmFsIn0
irb(main):023:0> crypt.decode(payload: token)
=> {"foo"=>"bar"}
Proposed implementation:
irb(main):014:0> token = crypt.encode(message, footer: footer)
# => v4.local.jTh2jNDVDEorc76BmXHcyo5H2XuJUs0WZ_VI4hAHMkPI9RCc3bO5I0QK9aky8XYHVAOqtUF11djUgr9PEMFb8jdFrznCiuiNn9lBL9Q.eyJzb21lIjoidmFsIn0
irb(main):023:0> crypt.decode(token, implicit_assertion: '')
=> {:body=>{"foo"=>"bar"}, :footer=>{"some"=>"val"}}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.