mail_mcp 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mail_mcp/app.rb +13 -3
- data/lib/mail_mcp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f0b9d571be35c953b87ae56a9fdf4b0fb06d025daf74679fe34f3c17d956bf2
|
|
4
|
+
data.tar.gz: ab679102a9001f05852218155c57fef7ddafa7ac5259cb5bd884b54ddb0ee20e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79c646575acf2f6e5dade303538b05622316152951fa66d3f265422ae409a12e0dbd0b42038a67deae8b30e5c4027849520bbd599b5d95714320dcf52a249ce7
|
|
7
|
+
data.tar.gz: 35c9e8c6ae7e4d791838a3ccf61cbfb89bfb14052514365c4ea320d8ee8e9747b5d26a7e3d03ba2284fac3184db2123bd53c28d40be2dff5fa46ab430ca7814b
|
data/lib/mail_mcp/app.rb
CHANGED
|
@@ -64,6 +64,7 @@ module MailMCP
|
|
|
64
64
|
token_endpoint: "#{base_url}/oauth/token",
|
|
65
65
|
response_types_supported: ["code"],
|
|
66
66
|
grant_types_supported: ["authorization_code"],
|
|
67
|
+
token_endpoint_auth_methods_supported: %w[client_secret_basic client_secret_post],
|
|
67
68
|
code_challenge_methods_supported: ["S256"]
|
|
68
69
|
})
|
|
69
70
|
end
|
|
@@ -106,9 +107,8 @@ module MailMCP
|
|
|
106
107
|
post "/oauth/token" do
|
|
107
108
|
content_type :json
|
|
108
109
|
|
|
109
|
-
grant_type
|
|
110
|
-
client_id
|
|
111
|
-
client_secret = params[:client_secret]
|
|
110
|
+
grant_type = params[:grant_type]
|
|
111
|
+
client_id, client_secret = client_credentials
|
|
112
112
|
|
|
113
113
|
client_config = begin
|
|
114
114
|
JwtService.decode_client_id(client_id.to_s)
|
|
@@ -146,6 +146,16 @@ module MailMCP
|
|
|
146
146
|
|
|
147
147
|
private
|
|
148
148
|
|
|
149
|
+
# RFC 6749 section 2.3.1: clients may authenticate with HTTP Basic, whose
|
|
150
|
+
# user and password are the form-encoded client_id and client_secret, or
|
|
151
|
+
# with both in the request body.
|
|
152
|
+
def client_credentials
|
|
153
|
+
auth = Rack::Auth::Basic::Request.new(request.env)
|
|
154
|
+
return [params[:client_id], params[:client_secret]] unless auth.provided? && auth.basic?
|
|
155
|
+
|
|
156
|
+
auth.credentials.map { |part| URI.decode_www_form_component(part) }
|
|
157
|
+
end
|
|
158
|
+
|
|
149
159
|
def resolve_mcp_context
|
|
150
160
|
auth = request.env["HTTP_AUTHORIZATION"]
|
|
151
161
|
return [nil, unauthorized_response("missing bearer token")] unless auth&.start_with?("Bearer ")
|
data/lib/mail_mcp/version.rb
CHANGED