-
Notifications
You must be signed in to change notification settings - Fork 492
feat(wiki): add +space-list, +node-list, +node-copy shortcuts #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
herbertliu
wants to merge
9
commits into
main
Choose a base branch
from
feat/wiki-organize-migrate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
427736b
feat(wiki): add +space-list, +node-list, +node-copy shortcuts
herbertliu 871627a
fix(wiki): address coderabbit review comments
herbertliu 01af364
Merge remote-tracking branch 'origin/main' into feat/wiki-organize-mi…
herbertliu 6d0522b
Merge remote-tracking branch 'origin/main' into feat/wiki-organize-mi…
herbertliu ebd2136
feat(wiki): add +node-move shortcut
herbertliu 005701b
merge: integrate main into feat/wiki-organize-migrate
herbertliu 734c0a5
Merge remote-tracking branch 'origin/main' into feat/wiki-organize-mi…
herbertliu 467d709
chore: add .tmp/ to .gitignore and untrack temporary files
herbertliu e98a6df
fix(wiki): address fangshuyu-768 review comments
herbertliu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,3 +36,4 @@ tests/mail/reports/ | |
| internal/registry/meta_data.json | ||
| cmd/api/download.bin | ||
| app.log | ||
| .tmp/ | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2026 Lark Technologies Pte. Ltd. | ||
| # SPDX-License-Identifier: MIT | ||
| # | ||
| # check-doc-tokens.sh | ||
| # | ||
| # Scans skill reference docs for token-like values that look realistic but | ||
| # are not using the required placeholder format (*_EXAMPLE_TOKEN or similar). | ||
| # | ||
| # Real token patterns (Lark API) often look like: | ||
| # wikcnXXXXXXXXX doccnXXXXXXX shtcnXXX fldcnXXX ou_XXXX cli_XXXX | ||
| # | ||
| # Docs MUST use clearly fake placeholders, e.g.: | ||
| # wikcn_EXAMPLE_TOKEN doccn_EXAMPLE_TOKEN <space_id> your_token_here | ||
| # | ||
| # If this check fails, replace the realistic-looking value with a placeholder | ||
| # like `wikcn_EXAMPLE_TOKEN` so gitleaks CI won't flag it as a real secret. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SKILLS_DIR="${1:-skills}" | ||
| ERRORS=0 | ||
|
|
||
| # Patterns that indicate a realistic-looking Lark token value inside a string. | ||
| # Matches JSON-style: "field": "token_value" or markdown backtick spans. | ||
| # Token prefixes used by Lark Open Platform: | ||
| # wikcn doccn docx shtcn bascn fldcn vewcn tbln ou_ cli_ obcn flec | ||
| # | ||
| # Excluded (clearly fake): | ||
| # - Values ending with EXAMPLE_TOKEN (e.g. wikcn_EXAMPLE_TOKEN) | ||
| # - Values that are all uppercase X (e.g. bascnXXXXXXXX) | ||
| # - Values containing only X/_/<> (e.g. <your_token>) | ||
| # Require at least one digit in the suffix — real API tokens are always alphanumeric | ||
| # with digits. Pure-letter suffixes (e.g. ou_manager, ou_director) are clearly fake names. | ||
| REALISTIC_TOKEN_RE='"(wikcn|doccn|docx[a-z]|shtcn|bascn|fldcn|vewcn|tbln|obcn|flec|ou_|cli_)[A-Za-z0-9]*[0-9][A-Za-z0-9]{3,}"|`(wikcn|doccn|docx[a-z]|shtcn|bascn|fldcn|vewcn|tbln|obcn|flec|ou_|cli_)[A-Za-z0-9]*[0-9][A-Za-z0-9]{3,}`' | ||
| PLACEHOLDER_RE='(EXAMPLE|_TOKEN|XXXX|xxxx|<|>|your_|_here)' | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| while IFS= read -r -d '' file; do | ||
| # grep returns exit 1 when no match — use || true to avoid set -e killing us | ||
| # Then filter out values that are clearly placeholders (EXAMPLE, XXXX, etc.) | ||
| matches=$(grep -nEo "$REALISTIC_TOKEN_RE" "$file" 2>/dev/null | grep -vE "$PLACEHOLDER_RE" || true) | ||
| if [[ -n "$matches" ]]; then | ||
| echo "" | ||
| echo "❌ $file" | ||
| echo " Contains realistic-looking token values that may trigger gitleaks:" | ||
| while IFS= read -r line; do | ||
| echo " $line" | ||
| done <<< "$matches" | ||
| echo " → Replace with a placeholder, e.g.: wikcn_EXAMPLE_TOKEN, doccn_EXAMPLE_TOKEN" | ||
| ERRORS=$((ERRORS + 1)) | ||
| fi | ||
| done < <(find "$SKILLS_DIR" -path "*/references/*.md" -print0) | ||
|
|
||
| if [[ $ERRORS -gt 0 ]]; then | ||
| echo "" | ||
| echo "❌ check-doc-tokens: $ERRORS file(s) contain realistic token values in reference docs." | ||
| echo " Use _EXAMPLE_TOKEN placeholders to avoid false positives in gitleaks CI." | ||
| exit 1 | ||
| else | ||
| echo "✅ check-doc-tokens: all reference docs use safe placeholder tokens." | ||
| fi | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this pattern/filter is too aggressive for the current docs set. Running the script on the repo already flags existing placeholder-ish examples like
ou_manager/ou_director, so the newmake gitleakstarget fails even before this PR’s docs are considered. Could we narrow the detection or broaden the placeholder allowlist first, otherwise contributors will get a broken pre-push/local check immediately?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ou_manager/ou_directorfalse-positive was already addressed in an earlier commit (e98a6df's predecessor):REALISTIC_TOKEN_REnow requires at least one digit in the token suffix, so pure-letter fake names likeou_managerare excluded. Runningbash scripts/check-doc-tokens.shon the current tree returns ✅ with no errors.