Skip to content

feat: support Viking API key auth - #1116

Merged
yaozheng-fang merged 1 commit into
volcengine:mainfrom
xgtcode:feat/viking-apikey-framework-auth
Sep 17, 2026
Merged

yaozheng-fang merged 1 commit into
volcengine:mainfrom
xgtcode:feat/viking-apikey-framework-auth

Conversation

@xgtcode

@xgtcode xgtcode commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Background

The latest VikingDB SDK supports APIKey authentication. VeADK should support API key access for existing VikingDB knowledgebase and memory resources at runtime, while keeping resource/collection management on AK/SK or VeFaaS IAM. This avoids passing API keys to Viking control-plane APIs that do not support them.

Changes

  • Added DATABASE_VIKING_API_KEY support for Viking knowledgebase.

    • search() uses Authorization: Bearer <api_key> when an API key is configured.
    • Collection/doc/chunk management continues to use AK/SK or IAM.
    • API-key-only initialization skips collection management precheck.
  • Added DATABASE_VIKINGMEM_API_KEY support for Viking memory.

    • Memory data-plane operations use the official SDK via VikingMem(auth=APIKey(...)).
    • Collection management continues to use AK/SK or IAM.
    • get_user_profile() now reuses SDK collection search_memory().
    • get_user_profile() raises on non-zero code responses instead of treating auth/service failures as an empty profile.
  • Updated the custom VikingDBMemoryClient.

    • Explicitly rejects API key auth for memory collection management.
    • Management APIs continue to use AK/SK signing.
  • Updated Studio and Harness behavior.

    • Studio Agent creation no longer exposes Viking API key configuration.
    • Studio Viking resource listing still requires server-side AK/SK/IAM.
    • Harness runtime env mapping keeps API key pass-through support.
  • Updated dependencies and docs.

    • Raised the minimum vikingdb-python-sdk version to one that includes APIKey.
    • Updated examples and configuration docs to clarify that API keys are for existing-resource data-plane access, while management still requires AK/SK/IAM.

Auth Priority

Data plane:

  1. Explicit api_key
  2. DATABASE_VIKING_API_KEY / DATABASE_VIKINGMEM_API_KEY
  3. AK/SK
  4. VeFaaS IAM

Management plane:

  1. AK/SK
  2. VeFaaS IAM

Management APIs do not use API key auth.

Verification

  • uv run pytest tests/test_vikingdb_knowledge_backend.py tests/test_vikingdb_memory_backend.py tests/cli/test_frontend_runtime_proxy.py -q -k "viking"

    • 44 passed
  • uv run pytest tests/cli/test_generated_agent_component_matrix.py tests/cloud/test_harness_app_contract.py -q

    • 133 passed
  • cd frontend && npm test

    • 1168 passed
  • cd frontend && npm run build

    • passed
  • cd frontend && npm run test:webui-assets

    • passed
  • git diff --check

    • passed
  • pre-commit run gitleaks --all-files

    • passed

Notes

ruff / pyright were also run against the changed Python files, but they hit existing repository-wide issues, such as historical lint findings in cli_frontend.py, a schema field conflicting with a Pydantic/BaseModel method, and existing Optional AK/SK type annotations. This PR does not include unrelated broad cleanup.

@xgtcode
xgtcode force-pushed the feat/viking-apikey-framework-auth branch from 3eaef0e to 4b9851d Compare September 17, 2026 07:53
@xgtcode
xgtcode force-pushed the feat/viking-apikey-framework-auth branch from 4b9851d to ac71516 Compare September 17, 2026 09:23
@yaozheng-fang
yaozheng-fang merged commit 5727bd6 into volcengine:main Sep 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants