From 9fd2e16b68e1a83e2605e8a9cbd9b6d04a4da2f6 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 4 Oct 2026 12:46:34 +0100 Subject: Take an app's requests only with a token its tokens file grants (017, 3b) An app given a tokens file (tokens=FILE in --apps, --tokens FILE for the one app of a host) answers a request only when it bears a token (Authorization: Bearer) whose SHA-256 the file lists with a grant: read for its views, queries and documents, write for all, input=NAME for those inputs alone; 401 unauthorized (WWW-Authenticate: Bearer) without one, 403 forbidden past its grant. A delivery sealed by a key --sender names needs none. The digests are compared in constant time; a connection keeps its last token's digest, so the same token is hashed once. SHA-256 is the host's own (serve/sha256.c), no OpenSSL loaded. A reading puts a changed tokens file in place with the app running on; a file that is not one stops the app. pure-serve --make-token GRANT makes a token and its line. load takes PURE_LOAD_TOKEN. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index af74e15..32fbc3e 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ INCLUDES = -Icore MODEL = core/module.c core/module-list.c core/module-save.c core/module-text.c core/module-store.c core/flow.c STORE = store/store-tree.c store/store-log.c LINK = link/link-protocol.c link/link.c link/sending.c link/crypto.c -SERVE = serve/serve.c serve/deliver.c serve/message-json.c +SERVE = serve/serve.c serve/deliver.c serve/message-json.c serve/sha256.c HEADERS = $(wildcard core/*.h) $(wildcard link/*.h) $(wildcard serve/*.h) $(wildcard store/*.h) OBJECTS = $(patsubst %.c,$(BUILD)/obj/%.o,$(MODEL) $(STORE)) LINK_OBJECTS = $(patsubst %.c,$(BUILD)/obj/%.o,$(LINK)) -- cgit v1.2.3