Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/mcp_server_vefaas_function/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ OAuth 2.0

### UVX

请预先获取环境变量 VOLC_ACCESSKEYVOLC_SECRETKEY
请预先获取环境变量 VOLCENGINE_ACCESS_KEYVOLCENGINE_SECRET_KEY

```json
{
Expand All @@ -614,8 +614,8 @@ OAuth 2.0
"mcp-server-vefaas-function"
],
"env": {
"VOLC_ACCESSKEY": "xxx",
"VOLC_SECRETKEY": "xxx"
"VOLCENGINE_ACCESS_KEY": "xxx",
"VOLCENGINE_SECRET_KEY": "xxx"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions server/mcp_server_vefaas_function/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"mcp-server-vefaas-function"
],
"env": {
"VOLC_ACCESSKEY": "xxx",
"VOLC_SECRETKEY": "xxx"
"VOLCENGINE_ACCESS_KEY": "xxx",
"VOLCENGINE_SECRET_KEY": "xxx"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
ContentType = "application/x-www-form-urlencoded"

# 请求的凭证,从IAM或者STS服务中获取
AK = os.getenv("VOLC_ACCESSKEY")
SK = os.getenv("VOLC_SECRETKEY")
AK = os.getenv("VOLCENGINE_ACCESS_KEY")
SK = os.getenv("VOLCENGINE_SECRET_KEY")
# 当使用临时凭证时,需要使用到SessionToken传入Header,并计算进SignedHeader中,请自行在header参数中添加X-Security-Token头
# SessionToken = ""

Expand Down Expand Up @@ -187,10 +187,10 @@ def get_authorization_credentials(ctx: Context = None) -> tuple[str, str, str]:
ValueError: If authorization information is missing or invalid
"""
# First try environment variables
if "VOLC_ACCESSKEY" in os.environ and "VOLC_SECRETKEY" in os.environ:
if "VOLCENGINE_ACCESS_KEY" in os.environ and "VOLCENGINE_SECRET_KEY" in os.environ:
return (
os.environ["VOLC_ACCESSKEY"],
os.environ["VOLC_SECRETKEY"],
os.environ["VOLCENGINE_ACCESS_KEY"],
os.environ["VOLCENGINE_SECRET_KEY"],
"" # No session token for static credentials
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
class TestVeFaaSServerIntegration(unittest.TestCase):
def setUp(self):
# Check if credentials are available
self.ak = os.environ.get("VOLC_ACCESSKEY")
self.sk = os.environ.get("VOLC_SECRETKEY")
self.ak = os.environ.get("VOLCENGINE_ACCESS_KEY")
self.sk = os.environ.get("VOLCENGINE_SECRET_KEY")
if not self.ak or not self.sk:
self.assertFalse(
"VOLC_ACCESSKEY or VOLC_SECRETKEY environment variables not set"
"VOLCENGINE_ACCESS_KEY or VOLCENGINE_SECRET_KEY environment variables not set"
)

def test_does_function_exist_with_real_credentials(self):
Expand Down