Accept TOKEN_FOR_GITEA_WIKI in .env and move the token howto to the wiki
TOKEN_FOR_GITEA_WIKI is an optional key, checked and masked but never used or asked for, so one .env can serve the wiki publishing too. GITHUB_PAT and GITHUB_USER are documented as required only when GitHub is chosen. The how-to for creating the access tokens moves from howto/ to the wiki as AccessTokens in English, Danish and Bahasa Malaysia, with its pictures in wiki/img/. README, Home and the sidebar link to it. Adds MIL-010 with its review RC-033 and the matching plan, user story and traceability rows. Task: MIL-010#1 Task: MIL-010#2 Task: MIL-010#3 Closes #83 Closes #84 Closes #85
This commit is contained in:
@@ -100,6 +100,7 @@ token too short|GITEA_TOKEN=short\n|not a valid token
|
||||
token with a backslash|GITEA_TOKEN=abc\\defgh12345\n|not a valid token
|
||||
bad GitHub token|GITEA_TOKEN=abcdefgh12345\nGITHUB_PAT=bad token\n|GITHUB_PAT
|
||||
bad GitHub user|GITEA_TOKEN=abcdefgh12345\nGITHUB_USER=-bad-\n|GITHUB_USER
|
||||
bad wiki token|TOKEN_FOR_GITEA_WIKI=short\n|TOKEN_FOR_GITEA_WIKI
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,21 @@ test_github_credentials_are_asked_only_when_github_is_chosen() {
|
||||
assert_not_contains "token not shown" "$OUT$ERR" "$FAKE_GITHUB_PAT"
|
||||
}
|
||||
|
||||
test_the_wiki_token_is_accepted_never_asked_and_never_shown() {
|
||||
local wiki_token="wikiFAKEtoken1234567890"
|
||||
setup_hosts
|
||||
printf 'GITEA_TOKEN=%s\nTOKEN_FOR_GITEA_WIKI=%s\n' "$FAKE_GITEA_TOKEN" "$wiki_token" >"$WORK/.env"
|
||||
run_dry_cred "$ANSWERS_GITEA_ONLY"
|
||||
assert_status "accepted in .env" 0 "$STATUS"
|
||||
assert_not_contains "not asked" "$ERR" "wiki"
|
||||
assert_not_contains "not shown" "$OUT$ERR" "$wiki_token"
|
||||
run_dry_cred "$ANSWERS_GITHUB$FAKE_GITHUB_PAT${NL}octo-user$NL"
|
||||
assert_status "accepted with GitHub chosen" 0 "$STATUS"
|
||||
assert_not_contains "not asked with GitHub" "$ERR" "wiki"
|
||||
assert_not_contains "not shown with GitHub" "$OUT$ERR" "$wiki_token"
|
||||
assert_not_contains "never sent to a host" "$(calls)" "$wiki_token"
|
||||
}
|
||||
|
||||
test_an_invalid_asked_value_is_asked_again_and_never_shown() {
|
||||
setup_hosts
|
||||
without_env
|
||||
|
||||
Reference in New Issue
Block a user