Sha256: 9c53c1f5c44dda7024d128468e6e9de56a8d64bc65759e27bb211c68e3744aef

Contents?: true

Size: 912 Bytes

Versions: 3

Compression:

Stored size: 912 Bytes

Contents

module OpenIDConnect
  module Discovery
    module Provider
      class Config
        class Resource < SWD::Resource
          undef_required_attributes :principal, :service

          class Expired < SWD::Resource::Expired; end

          def initialize(uri)
            @host = uri.host
            @port = uri.port unless [80, 443].include?(uri.port)
            @path ||= '/.well-known/openid-configuration'
            attr_missing!
          end

          def endpoint
            SWD.url_builder.build [nil, host, port, path, nil, nil]
          rescue URI::Error => e
            raise SWD::Exception.new(e.message)
          end

          private

          def to_response_object(hash)
            Response.new hash
          end

          def cache_key
            md5 = Digest::MD5.hexdigest host
            "swd:resource:opneid-conf:#{md5}"
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openid_connect-0.6.0 lib/openid_connect/discovery/provider/config/resource.rb
openid_connect-0.5.1 lib/openid_connect/discovery/provider/config/resource.rb
openid_connect-0.5.0 lib/openid_connect/discovery/provider/config/resource.rb