Class: RubyLLM::MCP::Auth::ClientMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/mcp/auth.rb

Overview

Client metadata for dynamic client registration (RFC 7591) Supports all optional parameters from the specification

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(redirect_uris:, token_endpoint_auth_method: "none", grant_types: %w[authorization_code refresh_token],, response_types: ["code"], scope: nil, client_name: nil, client_uri: nil, logo_uri: nil, contacts: nil, tos_uri: nil, policy_uri: nil, jwks_uri: nil, jwks: nil, software_id: nil, software_version: nil) ⇒ ClientMetadata

rubocop:disable Metrics/ParameterLists



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/ruby_llm/mcp/auth.rb', line 104

def initialize( # rubocop:disable Metrics/ParameterLists
  redirect_uris:,
  token_endpoint_auth_method: "none",
  grant_types: %w[authorization_code refresh_token],
  response_types: ["code"],
  scope: nil,
  client_name: nil,
  client_uri: nil,
  logo_uri: nil,
  contacts: nil,
  tos_uri: nil,
  policy_uri: nil,
  jwks_uri: nil,
  jwks: nil,
  software_id: nil,
  software_version: nil
)
  @redirect_uris = redirect_uris
  @token_endpoint_auth_method = token_endpoint_auth_method
  @grant_types = grant_types
  @response_types = response_types
  @scope = scope
  @client_name = client_name
  @client_uri = client_uri
  @logo_uri = logo_uri
  @contacts = contacts
  @tos_uri = tos_uri
  @policy_uri = policy_uri
  @jwks_uri = jwks_uri
  @jwks = jwks
  @software_id = software_id
  @software_version = software_version
end

Instance Attribute Details

#client_nameObject (readonly)

Returns the value of attribute client_name.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def client_name
  @client_name
end

#client_uriObject (readonly)

Returns the value of attribute client_uri.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def client_uri
  @client_uri
end

#contactsObject (readonly)

Returns the value of attribute contacts.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def contacts
  @contacts
end

#grant_typesObject (readonly)

Returns the value of attribute grant_types.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def grant_types
  @grant_types
end

#jwksObject (readonly)

Returns the value of attribute jwks.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def jwks
  @jwks
end

#jwks_uriObject (readonly)

Returns the value of attribute jwks_uri.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def jwks_uri
  @jwks_uri
end

#logo_uriObject (readonly)

Returns the value of attribute logo_uri.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def logo_uri
  @logo_uri
end

#policy_uriObject (readonly)

Returns the value of attribute policy_uri.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def policy_uri
  @policy_uri
end

#redirect_urisObject (readonly)

Returns the value of attribute redirect_uris.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def redirect_uris
  @redirect_uris
end

#response_typesObject (readonly)

Returns the value of attribute response_types.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def response_types
  @response_types
end

#scopeObject (readonly)

Returns the value of attribute scope.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def scope
  @scope
end

#software_idObject (readonly)

Returns the value of attribute software_id.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def software_id
  @software_id
end

#software_versionObject (readonly)

Returns the value of attribute software_version.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def software_version
  @software_version
end

#token_endpoint_auth_methodObject (readonly)

Returns the value of attribute token_endpoint_auth_method.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def token_endpoint_auth_method
  @token_endpoint_auth_method
end

#tos_uriObject (readonly)

Returns the value of attribute tos_uri.



100
101
102
# File 'lib/ruby_llm/mcp/auth.rb', line 100

def tos_uri
  @tos_uri
end

Instance Method Details

#to_hHash

Convert to hash for registration request

Returns:

  • (Hash)

    client metadata



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/ruby_llm/mcp/auth.rb', line 140

def to_h
  {
    redirect_uris: @redirect_uris,
    token_endpoint_auth_method: @token_endpoint_auth_method,
    grant_types: @grant_types,
    response_types: @response_types,
    scope: @scope,
    client_name: @client_name,
    client_uri: @client_uri,
    logo_uri: @logo_uri,
    contacts: @contacts,
    tos_uri: @tos_uri,
    policy_uri: @policy_uri,
    jwks_uri: @jwks_uri,
    jwks: @jwks,
    software_id: @software_id,
    software_version: @software_version
  }.compact
end