MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / api_verify_credentials

Function api_verify_credentials

plugin/app/routes/verify.py:34–65  ·  view source on GitHub ↗
(
    data: VerifyCredentialsRequest,
)

Source from the content-addressed store, hash-verified

32 include_in_schema=False,
33)
34async def api_verify_credentials(
35 data: VerifyCredentialsRequest,
36):
37 # encryption
38 bundle_handler: BundleHandler = get_bundle_handler(data.bundle_id)
39 if not bundle_handler:
40 raise_http_error(ErrorCode.OBJECT_NOT_FOUND, f"Bundle {data.bundle_id} not found.")
41
42 try:
43
44 await bundle_handler.verify(data.credentials)
45
46 except TKHttpException as e:
47 if isinstance(getattr(e, "detail"), dict):
48 message = e.detail.get("message")
49 if message:
50 message = " " + message
51 e.detail["message"] = f"Model credentials validation failed.{message}"
52 raise e
53
54 except Exception as e:
55 raise_http_error(
56 ErrorCode.CREDENTIALS_VALIDATION_ERROR,
57 message="Model credentials validation failed, please check if your credentials are correct.",
58 )
59
60 data.credentials.encrypt()
61 return BaseSuccessDataResponse(
62 data={
63 "encrypted_credentials": data.credentials.credentials,
64 }
65 )

Callers

nothing calls this directly

Calls 6

get_bundle_handlerFunction · 0.90
raise_http_errorFunction · 0.90
verifyMethod · 0.45
getMethod · 0.45
encryptMethod · 0.45

Tested by

no test coverage detected