authd/mk/commands.mk

26 lines
739 B
Makefile
Raw Normal View History

2024-11-30 12:02:01 +01:00
# REQUEST EXAMPLES
NAME ?= John
EMAIL ?= john@example.com
# For requests where authentication is required.
LOGIN ?=
ifeq ($(LOGIN),)
LOGIN_OPT =
else
LOGIN_OPT = -l $(LOGIN)
endif
ACTIVATION_KEY ?= put-your-key-here
add-user:; $(Q)$(LOC)authc user add $(NAME) $(EMAIL) $(LOGIN_OPT)
register:; $(Q)$(LOC)authc user register $(NAME) $(EMAIL)
validate:; $(Q)$(LOC)authc user validate $(NAME) $(ACTIVATION_KEY)
get-user:; $(Q)$(LOC)authc user get $(NAME) $(LOGIN_OPT)
SERVICE ?= 'auth'
RESOURCE ?= '*'
UID ?= 1000
PERMISSION ?= Read
permission-check:; $(LOC)authc permission check $(UID) $(SERVICE) $(RESOURCE) $(LOGIN_OPT)
permission-set:; $(LOC)authc permission set $(UID) $(SERVICE) $(RESOURCE) $(PERMISSION) $(LOGIN_OPT)