aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-04 12:46:34 +0100
committereunhhu <[email protected]>2026-10-04 12:46:34 +0100
commit9fd2e16b68e1a83e2605e8a9cbd9b6d04a4da2f6 (patch)
tree2ae9aaf2cc5f3e5d4eef0209d013ac8332c02984 /Makefile
parent1ff4fd3b1ae2b2ada273d7ffaee8501c9d43d5c0 (diff)
downloadpure-9fd2e16b68e1a83e2605e8a9cbd9b6d04a4da2f6.tar.gz
pure-9fd2e16b68e1a83e2605e8a9cbd9b6d04a4da2f6.zip
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
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))