2023-05-29 20:41:12 +02:00
|
|
|
all: build
|
|
|
|
|
|
|
|
NAME ?= John
|
|
|
|
EMAIL ?= john@example.com
|
2023-06-08 17:33:43 +02:00
|
|
|
|
2023-06-14 21:00:15 +02:00
|
|
|
# For requests where authentication is required.
|
|
|
|
LOGIN ?=
|
|
|
|
ifeq ($(LOGIN),)
|
|
|
|
LOGIN_OPT =
|
|
|
|
else
|
|
|
|
LOGIN_OPT = -l $(LOGIN)
|
|
|
|
endif
|
2023-06-08 17:33:43 +02:00
|
|
|
|
2023-06-14 21:00:15 +02:00
|
|
|
##################
|
|
|
|
### SETUP COMMANDS
|
|
|
|
##################
|
|
|
|
|
|
|
|
PASSWORD_FILE ?= /tmp/PASSWORD
|
2023-06-08 17:33:43 +02:00
|
|
|
setup:
|
|
|
|
@[ -f $(PASSWORD_FILE) ] || echo -n "coucou" > $(PASSWORD_FILE)
|
|
|
|
|
2023-06-14 21:00:15 +02:00
|
|
|
DATA_DIRECTORY ?= /tmp/DATA-AUTHD
|
2023-06-08 17:33:43 +02:00
|
|
|
run-authd: setup
|
|
|
|
./bin/authd -k /tmp/PASSWORD -R -E --storage $(DATA_DIRECTORY)
|
2023-05-29 20:41:12 +02:00
|
|
|
|
2023-06-14 21:00:15 +02:00
|
|
|
# First user always is the admin.
|
|
|
|
add-first-user:
|
|
|
|
./bin/authc bootstrap $(NAME) $(EMAIL)
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
### REQUEST EXAMPLES
|
|
|
|
####################
|
|
|
|
|
|
|
|
add-user:
|
|
|
|
./bin/authc user add $(NAME) $(EMAIL) $(LOGIN_OPT)
|
|
|
|
|
|
|
|
|
|
|
|
###################
|
|
|
|
### DEVELOPER TOOLS
|
|
|
|
###################
|
|
|
|
|
|
|
|
build-server:
|
|
|
|
shards build authd
|
|
|
|
build-client:
|
|
|
|
shards build authc
|
|
|
|
|
|
|
|
build: build-server build-client
|
|
|
|
|
2023-06-14 18:38:31 +02:00
|
|
|
doc:
|
|
|
|
crystal docs
|
|
|
|
|
|
|
|
HTTPD_ACCESS_LOGS ?= /tmp/access-authd-docs.log
|
|
|
|
HTTPD_ADDR ?= 127.0.0.1
|
|
|
|
HTTPD_PORT ?= 9000
|
|
|
|
DIR ?= docs
|
|
|
|
serve-doc:
|
|
|
|
darkhttpd $(DIR) --addr $(HTTPD_ADDR) --port $(HTTPD_PORT) --log $(HTTPD_ACCESS_LOGS)
|
|
|
|
|
2023-06-12 20:54:41 +02:00
|
|
|
print-messages:
|
|
|
|
cat src/requests/*.cr | ./bin/get-messages.awk
|
2023-06-13 03:16:59 +02:00
|
|
|
print-message-numbers:
|
2023-06-14 01:47:40 +02:00
|
|
|
make -s print-messages | grep -E "^[0-9]" | sort -n
|
2023-06-13 23:40:34 +02:00
|
|
|
print-messages-without-comments:
|
2023-06-14 01:47:40 +02:00
|
|
|
make -s print-messages | grep -vE '^[[:blank:]]+#'
|
2023-06-14 18:38:31 +02:00
|
|
|
print-response-messages:
|
2023-06-14 01:47:40 +02:00
|
|
|
cat src/responses/*.cr | ./bin/get-messages.awk
|
2023-06-14 18:38:31 +02:00
|
|
|
print-response-message-numbers:
|
|
|
|
make -s print-response-messages | grep -E "^[0-9]" | sort -n
|
|
|
|
print-response-messages-without-comments:
|
|
|
|
make -s print-response-messages | grep -vE '^[[:blank:]]+#'
|