Skip to content

feat(auth): recognise checksummed mku_ Make API keys - #124

Merged
JanKulhavy merged 5 commits into
mainfrom
feat/api-token-checksum
Dec 4, 2026
Merged

JanKulhavy merged 5 commits into
mainfrom
feat/api-token-checksum

Conversation

@JanKulhavy

@JanKulhavy JanKulhavy commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

https://make.atlassian.net/browse/TECH-623

Summary

Make API tokens will be issued in a checksummed form: mku_ + the token's UUID as 32 lowercase hex characters (no dashes) + a 6-character base62 checksum, e.g. mku_2b58802dd95a4715acd5b65acaaef4701nJqvq for UUID 2b58802d-d95a-4715-acd5-b65acaaef470. isAPIKey now treats that shape as an API key too, so such keys are sent as Authorization: Token … instead of Bearer ….

  • Only the shape is checked. The server verifies the checksum, and computing it here would need a CRC-32 implementation in runtimes where node:zlib is unavailable.
  • The hex body must be lowercase and the checksum exactly 6 characters of 0-9A-Za-z.
  • A bare UUIDv4 and mku_ + dashed UUID are recognised as before. Non-key values such as OAuth/JWT access tokens still go out as Bearer.

Includes the minor version bump to 1.21.0 (package.json and package-lock.json), as in earlier bumps. The new behavior is a feature with no breaking change.

Compatibility

The Make API will also accept Bearer with a checksummed key, so older SDK versions keep working with the new tokens.

Tests

  • test/make.spec.ts pins the Token scheme for a checksummed key.
  • test/utils.spec.ts covers acceptance of the checksummed form (including one with a wrong checksum, which is accepted by shape) and rejection of an uppercased body, a 5- and a 7-character checksum, a non-hex letter in the body, a non-base62 checksum character (- and _), a dashed UUID followed by a checksum, a leading space, a trailing newline and a checksummed body without the mku_ prefix.
  • npm test: 66 suites / 612 tests passed.

🤖 Generated with Claude Code

JanKulhavy and others added 3 commits December 2, 2026 16:28
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JanKulhavy
JanKulhavy requested a review from a team as a code owner December 3, 2026 08:05
JanKulhavy and others added 2 commits December 3, 2026 09:16
Checker findings (self-review). Each added case fails against one
plausible wrong pattern that the existing cases let through:

- a checksummed body without the mku_ prefix: matching the stripped
  body instead of the whole value
- a leading space: a pattern without the start anchor
- an underscore in the checksum: \w instead of the base62 class
- a trailing newline after the checksummed form: the multiline flag

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
No existing case put a lowercase letter outside a-f in the 32-character
body, so a pattern written with a-z for "lowercase hex" passed every
test.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@JanKulhavy
JanKulhavy enabled auto-merge (squash) December 3, 2026 20:27
@JanKulhavy
JanKulhavy merged commit 778c955 into main Dec 4, 2026
5 checks passed
@JanKulhavy
JanKulhavy deleted the feat/api-token-checksum branch December 4, 2026 07:25
JanKulhavy added a commit to integromat/make-cli that referenced this pull request Dec 4, 2026
https://make.atlassian.net/browse/TECH-623

## Summary
Updates `@makehq/sdk` from `^1.20.0` to `^1.21.0` (`package.json` and
`package-lock.json` only).

- **Checksummed API tokens:** SDK 1.21.0
([make-typescript-sdk#124](integromat/make-typescript-sdk#124))
recognises the checksummed `mku_` key (`mku_` + 32 lowercase hex
characters + a 6-character checksum) and sends it with the `Token`
scheme. The CLI passes the key through as is (`src/auth.ts`,
`src/login.ts` do no format check), so `make` works with the new tokens
without a code change. Bare-UUID and dashed `mku_` tokens work exactly
as before.
- **Why bump now:** with SDK 1.20.0 a checksummed key goes out as
`Bearer mku_…`, which imt-web-api only accepts through its Bearer
fallback. This is not a deploy gate for the rollout.
- **No new commands:** 1.21.0 adds no tools, so the command count stays
at 241 across 44 categories.

The CLI's own version is unchanged. Bump it in the usual separate
`chore: bump version` commit when releasing.

## Testing
Same results before and after the bump (Node 24.22.1 / npm 11.19.1):
- `npm test`: 4 suites / 104 tests pass.
- `npm run lint`, `npm run build` and `npm run build:docs` succeed (241
commands). `docs/` is git-ignored, so no generated files are committed.
- `npm ci --dry-run` passes on the new lockfile, run in a clean temp
dir.
- Auth scheme with the installed SDK, checked by stubbing `fetch` and
reading the `Authorization` header: UUID, dashed `mku_` and checksummed
`mku_` keys all send `Token`; an OAuth-style token still sends `Bearer`.
The CLI has no test for this.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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