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
> TODO: document how to manage users through `authc`.
> TODO: document how to manage users through `authctl`.
## APIs

View File

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

View File

@ -3,7 +3,7 @@ all: build-server
Q ?= @
# 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).
# To avoid that, use: "make <rule> LOC="
LOC ?= ./bin/

View File

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

View File

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

View File

@ -2,9 +2,9 @@ SOURCE_FILES = $(wildcard src/*.cr src/*/*.cr src/*/*/*.cr)
CRFLAGS ?= --progress
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-client: bin/authc
build-client: bin/authctl
build: build-server build-client
release:; make build-server CRFLAGS="--progress --release"

View File

@ -12,14 +12,14 @@ 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)
add-user:; $(Q)$(LOC)authctl user add $(NAME) $(EMAIL) $(LOGIN_OPT)
register:; $(Q)$(LOC)authctl user register $(NAME) $(EMAIL)
validate:; $(Q)$(LOC)authctl user validate $(NAME) $(ACTIVATION_KEY)
get-user:; $(Q)$(LOC)authctl 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)
permission-check:; $(LOC)authctl permission check $(UID) $(SERVICE) $(RESOURCE) $(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
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-binaries: install-authd install-authc
install-authctl: build-client ; $(Q)install -D -m 555 ./bin/authctl $(DESTDIR)$(BINDIR)/authctl
install-binaries: install-authd install-authctl
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-authc: gz-man-authc ; $(Q)install -D -m 444 ./man/authc.1.gz $(DESTDIR)$(MANDIR)/man1/authc.1.gz
install-man: install-man-authd install-man-authc
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-authctl
doc:; crystal docs
install-dev-doc: doc ; $(Q)install -D docs/ $(DESTDIR)$(DOCDIR)

View File

@ -22,10 +22,10 @@ $(USER_DB):
migration-file: $(USER_DB)
migrate-user:
./bin/authc user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT)
./bin/authctl user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT)
migrate-all-users:
@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

View File

@ -11,7 +11,7 @@ run-authd: setup
--service-name "auth"
# 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)

View File

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

View File

@ -103,7 +103,7 @@ class Actions
# 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".
def migration_script