Files
marqdo/tests/ext/web-security-smoke.mq.md
T
cflmyandCursor b5c07385e9 feat(markup): finish v0.3 stock migration and green gold
Migrate remaining .mq.md (tests/ext/public/examples), stop elevating local assigns to params, inject form_target in Go libweb, and skip live LLM gold without a real key.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 23:43:44 +08:00

1.0 KiB


title: web security smoke (W3) description: Password hash ABI + legacy plaintext login (offline). import web:ext/web/web.mq.md import plugin:lib/plugin.mq.md import sys:lib/sys.mq.md

main

p = > plugin.native_path name="web"

  1. p

plugin.load path=p

sys.exit code=1

hash = > web_password_hash password="secret" h = hash[^hash]

  1. h != ""

print text=hash-ok

print text=hash-fail

users =

行 用户 密码
1 admin secret

login = > web_auth_login username="admin" password="secret" users=users session_ttl=120 lok = login[^ok]

  1. lok

print text=auth-login-ok

print text=auth-login-fail

bad = > web_auth_login username="admin" password="wrong" users=users session_ttl=120 bok = bad[^ok]

  1. bok

print text=auth-bad-should-fail

print text=auth-bad-reject-ok