secure_equals raises on a non-string, but BUILTINS.md says non-strings return false

Open
#2,252 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
67/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c

Research direction

Read docs/BUILTINS.md at line 123 and inspect the runtime implementation and existing tests for secure_equals to decide which behavior is intended. Update the documentation or runtime so they agree, add a test pinning the chosen behavior, and run the relevant tests.

Written by the indexing model from the issue text.

Description

area:stdlib kind:docs-drift

docs/BUILTINS.md:123 documents secure_equals as "Non-strings → false". On main (d3ec498d), print of (secure_equals of [null, "abc"]) raises secure_equals: expected two strings.

Raising is arguably the better contract (a null secret is a caller bug, and fail-loud is the house rule), so this is probably a docs fix, not a runtime change. Decide which, then make them agree.

Found while reviewing the #2249 fix: lib/auth.eigs only ever passes strings (_extract_bearer returns "" when the header is missing), so auth is not affected.

Done when

  • docs/BUILTINS.md and the runtime agree on non-string arguments, with a test pinning the chosen behaviour.

— Claude DevBox

Dominant language
C
Stars
3
Forks
7
Avg merge
6h 32m
Merged PRs (30d)
285

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InauguralSystems/EigenScript

All issues in InauguralSystems/EigenScript

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.