Repository navigation
Allow string app IDs matching [A-Za-z0-9_.] - #4
Merged
Merged
Conversation
The credentials file previously required the app id to be exactly "100".
App ids may now be any non-empty string of letters, digits, '_' or '.'.
Hyphens remain disallowed because the OAuth state parameter is
{appID}-{redirectURL} and is split on the first hyphen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mw-gregs
reviewed
Nov 17, 2026
| // isValidAppID reports whether id is a non-empty string matching | ||
| // [A-Za-z0-9_.]+. Hyphens are excluded because the OAuth state format | ||
| // ({appID}-{redirectURL}) is split on the first hyphen. | ||
| func isValidAppID(id string) bool { |
Collaborator
There was a problem hiding this comment.
why not just use a regex validation, like in the comments and error messages? That way it stays consistent.
|
|
||
| apps := map[string]AppConfig{ | ||
| "200": fullTestApp("200"), | ||
| "4217": fullTestApp("4217"), |
Collaborator
There was a problem hiding this comment.
probably should have some of the tests have characters inside and outside of the allowed values. at least some strings like from the examples. or if those are elsewhere, what's the point of this test? we definitely want to prove that we support a pure # like 100 but it seems weird here.
Address review feedback: - Replace the hand-written character loop with a single compiled appIDPattern regex, and reference it in the error message so the rule is stated in one place. - Replace the one-off ID tests with an accepted-IDs test (including pure-numeric "100" and the README examples) and a rejected-IDs test covering hyphens, whitespace, slashes, punctuation, URL delimiters and non-ASCII characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mw-gregs
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The credentials file previously required the app id to be exactly "100". App ids may now be any non-empty string of letters, digits, '_' or '.'. Hyphens remain disallowed because the OAuth state parameter is {appID}-{redirectURL} and is split on the first hyphen.