Skip to content

[Feature] Developer personal access tokens and API keys #3333

Closed as not planned

Description

@master-kanor

Confirmations

  • I have read and agree to AGPL-3.0 Section 15. The program is provided "as is" without any warranties; you bear all risks of using it.
  • I have read and agree to AGPL-3.0 Section 16. The copyright holders and distributors are not liable for any damages resulting from the use or inability to use the program.
  • I confirm my description is clear, polite, helps developers quickly locate the issue, and complies with community rules.
  • I have read the Open-Box documentation.
  • I confirm there are no duplicate issues or discussions.
  • I believe this issue must be handled by Open-Box and not by a third party.
  • I confirm this feature has not been implemented yet.
  • I confirm this feature is reasonable and has general demand, not just my personal need.

Feature Description

Open-Box currently offers only two credential types for machine access: the single global admin site token (shared, all-powerful) and per-user login JWTs (short-lived, tied to password logins). There is no way for a user to issue a scoped, revocable personal access token (PAT) for scripts, AI agents (Claude, ChatGPT plugins), Composio toolkits, or open-connect connectors.

This is the foundational credential layer for using Open-Box as a personal/family data warehouse connected to external tooling.

Suggested Solution

  • New AccessToken model (user-scoped): id, user_id, name, prefix (for display, e.g. obk_a1b2...), token_hash (sha256, never store raw), scopes (e.g. fs:read, fs:write, fs:list, share:read, task:read), expires_at, last_used_at, revoked_at, timestamps.
  • Raw token shown once at creation (obk_<random>), stored hashed.
  • Auth middleware: accept Authorization: Bearer obk_..., resolve to user + scopes, attach to context; enforce scope checks on /api/fs/* (read vs write) and MCP tool calls.
  • Admin self-service API under /api/me/token/*: create (with scopes + expiry), list, revoke. Users can only manage their own tokens.
  • Rate-limit and audit last_used_at updates (throttled).
  • Admin site token behavior unchanged for backward compatibility.

Additional Information

Survey of current code (main @ 1efa7f9): JWT issuance in server/handles/auth.go (loginHash -> common.GenerateToken), process-local invalidation in server/common/auth.go, auth middleware in server/middlewares/auth.go (Auth/Authn), MCP auth in server/mcp/oauth.go. No PAT model exists; internal/db/db.go AutoMigrate list has no token table.

AI Generated Content (optional)

Drafted with AI assistance (Qoder); no chat log attached.

Activity

  1. github-actions commented on Oct 31, 2026

    @github-actions

    ⚠️ 你的 Issue 不符合提交规则。请先阅读相关规范后再重新提交。当前 Issue 将被自动关闭并锁定。如需继续提交,请确认已了解规则后创建新的 Issue。
    ⚠️ Your issue does not comply with the submission rules. Please read the guidelines before submitting again. This issue will be automatically closed and locked. If you wish to proceed, please confirm that you have reviewed the rules before creating a new issue.

  2. locked and limited conversation to collaborators on Oct 31, 2026
  3. jyxjjj commented on Oct 31, 2026

    @jyxjjj
    Member

    Duplicate of #46, which is already planned for v5.0.

    Our Security Policy explicitly states that privilege isolation between authenticated users is not a guaranteed security boundary in v4.x. We don’t recommend creating accounts for people you don’t personally know and trust.

    Scoped tokens depend on the underlying permission system, so we won’t be adding them separately to v4.x. Related requests are already tracked in #46 and #623.

    Also, several parts of this issue refer to Open-Box rather than OpenList. Please check that future requests are based on the correct project.

    Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidInvalid Content/Cannot Reproduce

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions