Sha256: e4e3b82a2d19a253f5484bfb9bc7fd5777584226c894bdcf0ba948afa535fc4c

Contents?: true

Size: 321 Bytes

Versions: 9

Compression:

Stored size: 321 Bytes

Contents

module JSON
  class JWK::Set < Array
    def initialize(*jwks)
      replace Array(jwks).flatten
    end

    def content_type
      'application/jwk-set+json'
    end

    def as_json(options = {})
      # NOTE: Array.new wrapper is requied to avoid CircularReferenceError
      {keys: Array.new(self)}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
json-jwt-1.1.0 lib/json/jwk/set.rb
json-jwt-1.0.3 lib/json/jwk/set.rb
json-jwt-1.0.2 lib/json/jwk/set.rb
json-jwt-1.0.1 lib/json/jwk/set.rb
json-jwt-1.0.0 lib/json/jwk/set.rb
json-jwt-0.8.1 lib/json/jwk/set.rb
json-jwt-0.8.0 lib/json/jwk/set.rb
json-jwt-0.7.1 lib/json/jwk/set.rb
json-jwt-0.7.0 lib/json/jwk/set.rb