Rename authc in authctl.

This commit is contained in:
Philippe Pittoli 2024-12-11 11:34:45 +01:00
parent d1e3a5f5f3
commit 4d6991798d
12 changed files with 34 additions and 34 deletions

View File

@ -32,7 +32,7 @@ To migrate an instance of authd, a simple copy of the storage directory will be
### Administrating users ### Administrating users
> TODO: document how to manage users through `authc`. > TODO: document how to manage users through `authctl`.
## APIs ## APIs

View File

@ -20,7 +20,7 @@ They are simpler, use less memory and computation.
### CLI client ### CLI client
Current client **authc** lacks most requests. Current client **authctl** lacks most requests.
### Documentation ### Documentation

View File

@ -3,7 +3,7 @@ all: build-server
Q ?= @ Q ?= @
# By default, the following makefile rules will use the compiled version # By default, the following makefile rules will use the compiled version
# of the applications (authd, authc), not the ones from the system # of the applications (authd, authctl), not the ones from the system
# (in /usr/local/bin/ for example). # (in /usr/local/bin/ for example).
# To avoid that, use: "make <rule> LOC=" # To avoid that, use: "make <rule> LOC="
LOC ?= ./bin/ LOC ?= ./bin/

View File

@ -2,24 +2,24 @@
.\" . = application with a manual page .\" . = application with a manual page
.\" Recent mdoc style: .\" Recent mdoc style:
.Dd 24 november 2024 .Dd 24 november 2024
.Dt "authc" 1 .Dt "authctl" 1
.Os Linux "(Ubuntu and Alpine)" .Os Linux "(Ubuntu and Alpine)"
.Sh Name .Sh Name
.Nm authc .Nm authctl
.Nd a client for the .Nd a client for the
.Xr authd 1 .Xr authd 1
authentication daemon. authentication daemon.
.Sh Description .Sh Description
.Nm authc .Nm authctl
is a client for the is a client for the
.Xr authd 1 .Xr authd 1
daemon, a micro-service providing authentication and authorization services. daemon, a micro-service providing authentication and authorization services.
.Sh Synopsis .Sh Synopsis
. .
.Nm authc .Nm authctl
.Op Fl h .Op Fl h
.Ar COMMAND No .Ar COMMAND No
.Op Ar help .Op Ar help
@ -70,7 +70,7 @@ password: banana
In this example, the login and password of the user are set. In this example, the login and password of the user are set.
The The
.Xr authc .Xr authctl
application won't require them as command-line parameters for performing authenticated actions. application won't require them as command-line parameters for performing authenticated actions.
.Sh Configuration file variables .Sh Configuration file variables
@ -104,20 +104,20 @@ Show some help, but won't cover as much as the actual manual.
Add the first user (will automatically be an admin). Add the first user (will automatically be an admin).
.br .br
.Nm authc .Nm authctl
.Ar bootstrap No .Ar bootstrap No
.Ar login .Ar login
.Ar email-address .Ar email-address
(Temporary, will be removed someday) add a batch of users from old code base. (Temporary, will be removed someday) add a batch of users from old code base.
.br .br
.Nm authc .Nm authctl
.Ar migration-script No .Ar migration-script No
Operations on users. Operations on users.
.br .br
.Nm authc .Nm authctl
.Ar user No .Ar user No
.Ar subcommand No .Ar subcommand No
@ -197,7 +197,7 @@ to learn more about the parameters and options of the subcommands.)
Operations on permissions. Operations on permissions.
.br .br
.Nm authc .Nm authctl
.Ar permission No .Ar permission No
.Brq set \*(Ba check .Brq set \*(Ba check
@ -209,7 +209,7 @@ Available permissions:
.Em none read edit admin . .Em none read edit admin .
.It "" .It ""
Example: Example:
.Nm authc .Nm authctl
.Ar permission set 1000 dnsmanager .Ar permission set 1000 dnsmanager
"*" "*"
.Ar edit .Ar edit
@ -221,7 +221,7 @@ Available permissions:
.Em none read edit admin . .Em none read edit admin .
.It "" .It ""
Example: Example:
.Nm authc .Nm authctl
.Ar permission check 1000 forum .Ar permission check 1000 forum
"/thread15/" "/thread15/"
.El .El
@ -268,7 +268,7 @@ a document database library used in
.Sh Limitations .Sh Limitations
WARNING: WARNING:
.Xr authc .Xr authctl
doesn't handle all possible commands of the doesn't handle all possible commands of the
.Xr authd .Xr authd
application. application.

View File

@ -232,7 +232,7 @@ TODO: expand the documentation
the documentation of the way libipc works the documentation of the way libipc works
. .
.It .It
.Xr authc 1 .Xr authctl 1
a command-line-interface client for a command-line-interface client for
.Xr authd .Xr authd
. .

View File

@ -2,9 +2,9 @@ SOURCE_FILES = $(wildcard src/*.cr src/*/*.cr src/*/*/*.cr)
CRFLAGS ?= --progress CRFLAGS ?= --progress
bin/authd: $(SOURCE_FILES); $(Q)shards build authd $(CRFLAGS) bin/authd: $(SOURCE_FILES); $(Q)shards build authd $(CRFLAGS)
bin/authc: $(SOURCE_FILES); $(Q)shards build authc $(CRFLAGS) bin/authctl: $(SOURCE_FILES); $(Q)shards build authctl $(CRFLAGS)
build-server: bin/authd build-server: bin/authd
build-client: bin/authc build-client: bin/authctl
build: build-server build-client build: build-server build-client
release:; make build-server CRFLAGS="--progress --release" release:; make build-server CRFLAGS="--progress --release"

View File

@ -12,14 +12,14 @@ LOGIN_OPT = -l $(LOGIN)
endif endif
ACTIVATION_KEY ?= put-your-key-here ACTIVATION_KEY ?= put-your-key-here
add-user:; $(Q)$(LOC)authc user add $(NAME) $(EMAIL) $(LOGIN_OPT) add-user:; $(Q)$(LOC)authctl user add $(NAME) $(EMAIL) $(LOGIN_OPT)
register:; $(Q)$(LOC)authc user register $(NAME) $(EMAIL) register:; $(Q)$(LOC)authctl user register $(NAME) $(EMAIL)
validate:; $(Q)$(LOC)authc user validate $(NAME) $(ACTIVATION_KEY) validate:; $(Q)$(LOC)authctl user validate $(NAME) $(ACTIVATION_KEY)
get-user:; $(Q)$(LOC)authc user get $(NAME) $(LOGIN_OPT) get-user:; $(Q)$(LOC)authctl user get $(NAME) $(LOGIN_OPT)
SERVICE ?= 'auth' SERVICE ?= 'auth'
RESOURCE ?= '*' RESOURCE ?= '*'
UID ?= 1000 UID ?= 1000
PERMISSION ?= Read PERMISSION ?= Read
permission-check:; $(LOC)authc permission check $(UID) $(SERVICE) $(RESOURCE) $(LOGIN_OPT) permission-check:; $(LOC)authctl permission check $(UID) $(SERVICE) $(RESOURCE) $(LOGIN_OPT)
permission-set:; $(LOC)authc permission set $(UID) $(SERVICE) $(RESOURCE) $(PERMISSION) $(LOGIN_OPT) permission-set:; $(LOC)authctl permission set $(UID) $(SERVICE) $(RESOURCE) $(PERMISSION) $(LOGIN_OPT)

View File

@ -6,15 +6,15 @@ DOCDIR ?= $(SHAREDIR)/doc/authd
MANDIR ?= $(SHAREDIR)/man MANDIR ?= $(SHAREDIR)/man
install-authd: build-server ; $(Q)install -D -m 555 ./bin/authd $(DESTDIR)$(BINDIR)/authd install-authd: build-server ; $(Q)install -D -m 555 ./bin/authd $(DESTDIR)$(BINDIR)/authd
install-authc: build-client ; $(Q)install -D -m 555 ./bin/authc $(DESTDIR)$(BINDIR)/authc install-authctl: build-client ; $(Q)install -D -m 555 ./bin/authctl $(DESTDIR)$(BINDIR)/authctl
install-binaries: install-authd install-authc install-binaries: install-authd install-authctl
gz-man-authd:; $(Q)gzip -k -f --best ./man/authd.1 gz-man-authd:; $(Q)gzip -k -f --best ./man/authd.1
gz-man-authc:; $(Q)gzip -k -f --best ./man/authc.1 gz-man-authctl:; $(Q)gzip -k -f --best ./man/authctl.1
install-man-authd: gz-man-authd ; $(Q)install -D -m 444 ./man/authd.1.gz $(DESTDIR)$(MANDIR)/man1/authd.1.gz install-man-authd: gz-man-authd ; $(Q)install -D -m 444 ./man/authd.1.gz $(DESTDIR)$(MANDIR)/man1/authd.1.gz
install-man-authc: gz-man-authc ; $(Q)install -D -m 444 ./man/authc.1.gz $(DESTDIR)$(MANDIR)/man1/authc.1.gz install-man-authctl: gz-man-authctl ; $(Q)install -D -m 444 ./man/authctl.1.gz $(DESTDIR)$(MANDIR)/man1/authctl.1.gz
install-man: install-man-authd install-man-authc install-man: install-man-authd install-man-authctl
doc:; crystal docs doc:; crystal docs
install-dev-doc: doc ; $(Q)install -D docs/ $(DESTDIR)$(DOCDIR) install-dev-doc: doc ; $(Q)install -D docs/ $(DESTDIR)$(DOCDIR)

View File

@ -22,10 +22,10 @@ $(USER_DB):
migration-file: $(USER_DB) migration-file: $(USER_DB)
migrate-user: migrate-user:
./bin/authc user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT) ./bin/authctl user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT)
migrate-all-users: migrate-all-users:
@echo "Don't forget the admin login, for example: LOGIN=dnsmanager" @echo "Don't forget the admin login, for example: LOGIN=dnsmanager"
./bin/authc migration-script $(USER_DB) $(LOGIN_OPT) ./bin/authctl migration-script $(USER_DB) $(LOGIN_OPT)
migration: migration-file migrate-all-users migration: migration-file migrate-all-users

View File

@ -11,7 +11,7 @@ run-authd: setup
--service-name "auth" --service-name "auth"
# First user always is the admin. # First user always is the admin.
add-first-user:; $(Q)$(LOC)authc bootstrap $(NAME) $(EMAIL) add-first-user:; $(Q)$(LOC)authctl bootstrap $(NAME) $(EMAIL)
setup:; @[ -f $(PASSWORD_FILE) ] || echo -n "coucou" > $(PASSWORD_FILE) setup:; @[ -f $(PASSWORD_FILE) ] || echo -n "coucou" > $(PASSWORD_FILE)

View File

@ -10,7 +10,7 @@ authors:
targets: targets:
authd: authd:
main: src/server.cr main: src/server.cr
authc: authctl:
main: src/client.cr main: src/client.cr
crystal: 1.7.1 crystal: 1.7.1

View File

@ -103,7 +103,7 @@ class Actions
# Migrate a batch of users from dnsmanager v1. # Migrate a batch of users from dnsmanager v1.
# #
# Usage: authc migration-script user-db.txt # Usage: authctl migration-script user-db.txt
# #
# user-db.txt should be formated as "login <TAB> old-hash". # user-db.txt should be formated as "login <TAB> old-hash".
def migration_script def migration_script