Skip to content

Commit f94158d

Browse files
committed
refactor basic autenticate
1 parent bcb9754 commit f94158d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
"containerEnv": {
1616
"KAMAL_REGISTRY_PASSWORD": "$KAMAL_REGISTRY_PASSWORD",
17-
"DB_HOST": "postgres"
17+
"DB_HOST": "postgres",
18+
"MCP_PASSWORD": "mcp_password",
19+
"MCP_USERNAME": "mcp_username"
1820
},
1921

2022
// Configure tool-specific properties.

.vscode/mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "http",
55
"url": "http://localhost:3000/mcp",
66
// "headers": {
7-
// // "Basic #{Base64.strict_encode64("mcp_username:mcp_password")}"
7+
// // "Basic #{Base64.strict_encode64("#{ENV["MCP_USERNAME"]}:#{ENV["MCP_PASSWORD"]}")}"
88
// "Authorization": "Basic bWNwX3VzZXJuYW1lOm1jcF9wYXNzd29yZA=="
99
// }
1010
}

app/controllers/mcp_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def handle
4747

4848
def authenticate!
4949
authenticate_or_request_with_http_basic do |username, password|
50-
username == "mcp_username" && password == "mcp_password"
50+
username == ENV["MCP_USERNAME"] && password == ENV["MCP_PASSWORD"]
5151
end
5252
end
5353
end

0 commit comments

Comments
 (0)