Skip to content

feat(auth): add mcp authorization endpoint types - #85

Open
akulistus wants to merge 12 commits into
masterfrom
feat/mcp-authorization-types
Open

akulistus wants to merge 12 commits into
masterfrom
feat/mcp-authorization-types

Conversation

@akulistus

@akulistus akulistus commented Oct 27, 2026 •

Copy link
Copy Markdown
  • Adds Database scheme for third-party clients
  • Adds OAuth request, response and error interfaces

@neSpecc neSpecc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Основное:

  1. В контракте нет code_challenge_method и resource — без них API не сможет ни проверить метод PKCE, ни привязать токен к MCP-серверу.
  2. Ответ с ошибкой не описан, и garage уводит пользователя на /undefined.
  3. Типы пока не используются ни в API, ни в garage.

Подробности в комментариях.

Comment thread src/auth/mcp/authorizationEndpoint.ts Outdated
/**
* Base64-URL-encoded string of the SHA256 hash of the code verifier
*/
code_challenge: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В запросе не хватает code_challenge_method, resource (RFC 8707), scope и response_type — garage их не передаст, а API не сможет проверить.

  • По OAuth 2.1 без code_challenge_method по умолчанию считается plain. Такой клиент пройдёт consent и только на обмене кода получит непонятный invalid_grant, потому что API всегда считает S256.
  • Спека MCP требует от клиентов параметр resource. Без него токен нельзя привязать к MCP-серверу (audience) — это главный вопрос из ревью API (hawk.api.nodejs PR 681).
  • Без scope скоупы так и останутся декоративными.

Предлагаю добавить code_challenge_method: 'S256', resource?: string, scope?: string.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

  • resource and scope parameters currently are not being used, but I still added them just in case

Comment thread src/auth/mcp/authorizationEndpoint.ts Resolved
Comment thread src/auth/mcp/authorizationEndpoint.ts Resolved
Comment thread index.ts Resolved
Comment thread src/auth/mcp/authorizationEndpoint.ts Resolved
Comment thread src/auth/mcp/authorizationEndpoint.ts Resolved
@neSpecc

neSpecc commented Oct 30, 2026

Copy link
Copy Markdown
Member

Для UI помимо имени приложения еще неплохо бы иметь поле picture (опциональное)

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