feat: lifetime elision, tooling CI, registry, and LSP locals
Ship the QUALITY_PLAN stretch from ownership through ecosystem: C.1 lifetime elision (bootstrap + selfhost), bux fmt/test/doc CI hooks, stdlib goldens, package registry (bux search/add), and LSP 0.4 position-sensitive locals with inferred let types. Full-tree format pass plus Map/Set remove double-free fix.
This commit is contained in:
+7
-7
@@ -29,30 +29,30 @@ func Jwt_Create(payload: JsonValue, secret: String) -> String {
|
||||
let header: JsonValue = Json_Object();
|
||||
Json_ObjectSet(&header, "alg", Json_String("HS256"));
|
||||
Json_ObjectSet(&header, "typ", Json_String("JWT"));
|
||||
|
||||
|
||||
let headerB64: String = Base64UrlEncode(Json_Stringify(header));
|
||||
let payloadB64: String = Base64UrlEncode(Json_Stringify(payload));
|
||||
|
||||
|
||||
let signingInput: String = String_Concat(headerB64, ".");
|
||||
signingInput = String_Concat(signingInput, payloadB64);
|
||||
|
||||
|
||||
let sigRaw: String = Crypto_HmacSha256Raw(secret, signingInput);
|
||||
let sigB64: String = Base64UrlEncodeSig(sigRaw);
|
||||
|
||||
|
||||
return String_Concat(String_Concat(signingInput, "."), sigB64);
|
||||
}
|
||||
|
||||
func Main() -> int {
|
||||
PrintLine("=== JWT Demo ===");
|
||||
|
||||
|
||||
let payload: JsonValue = Json_Object();
|
||||
Json_ObjectSet(&payload, "sub", Json_String("user123"));
|
||||
Json_ObjectSet(&payload, "name", Json_String("Bux Developer"));
|
||||
Json_ObjectSet(&payload, "admin", Json_Bool(true));
|
||||
|
||||
|
||||
let token: String = Jwt_Create(payload, "my-secret-key");
|
||||
PrintLine("Token:");
|
||||
PrintLine(token);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user