lib/drillbit/tokens/json_web_tokens/null.rb in drillbit-0.0.1 vs lib/drillbit/tokens/json_web_tokens/null.rb in drillbit-1.0.0

- old
+ new

@@ -1,13 +1,56 @@ # frozen_string_literal: true +require 'drillbit/configuration' require 'drillbit/tokens/null' module Drillbit module Tokens module JsonWebTokens class Null < Tokens::Null - def to_h - [{}, {}] + def audience + nil + end + + def issued_at + nil + end + + def issuer + nil + end + + def expiration + nil + end + + def id + nil + end + + def not_before + nil + end + + def owner_id + nil + end + + def subject_id + nil + end + + def subject + nil + end + + Drillbit.configuration.available_token_roles.each do |role| + define_method("#{role}?") do + false + end + end + + def roles + [] end end end end end