Junie: TOTP flow update and db migrations.
This commit is contained in:
79
README.org
79
README.org
@@ -41,7 +41,12 @@
|
||||
|
||||
* CLI Commands
|
||||
|
||||
MCIAS provides a command-line interface with the following commands:
|
||||
MCIAS provides two command-line interfaces:
|
||||
|
||||
1. The server CLI (`mcias`) for managing the MCIAS server
|
||||
2. The client CLI (`mcias-client`) for interacting with the MCIAS server
|
||||
|
||||
** Server CLI Commands
|
||||
|
||||
** Server Command
|
||||
|
||||
@@ -81,6 +86,23 @@
|
||||
go run main.go token list
|
||||
#+end_src
|
||||
|
||||
** Migrate Commands
|
||||
|
||||
Apply database migrations:
|
||||
#+begin_src bash
|
||||
go run main.go migrate up [--migrations <dir>] [--steps <n>]
|
||||
#+end_src
|
||||
|
||||
Revert database migrations:
|
||||
#+begin_src bash
|
||||
go run main.go migrate down [--migrations <dir>] [--steps <n>]
|
||||
#+end_src
|
||||
|
||||
Show current migration version:
|
||||
#+begin_src bash
|
||||
go run main.go migrate version [--migrations <dir>]
|
||||
#+end_src
|
||||
|
||||
* API Overview
|
||||
|
||||
** Authentication Endpoints
|
||||
@@ -128,3 +150,58 @@
|
||||
- Error handling correctness
|
||||
|
||||
See the [[file:docs/installation.org][Installation and Usage Guide]] for more details.
|
||||
|
||||
* Client Tool
|
||||
|
||||
MCIAS includes a separate command-line client tool (`mcias-client`) that can be used to interact with the MCIAS server. The client tool provides access to all the APIs defined in the server.
|
||||
|
||||
** Installation
|
||||
|
||||
To build and install the client tool:
|
||||
|
||||
#+begin_src bash
|
||||
cd cmd/mcias-client
|
||||
go build -o mcias-client
|
||||
# Optional: Move to a directory in your PATH
|
||||
sudo mv mcias-client /usr/local/bin/
|
||||
#+end_src
|
||||
|
||||
** Client CLI Commands
|
||||
|
||||
*** Login Commands
|
||||
|
||||
Login with username and password:
|
||||
#+begin_src bash
|
||||
mcias-client login password --username <username> --password <password> [--totp <code>]
|
||||
#+end_src
|
||||
|
||||
Login with a token:
|
||||
#+begin_src bash
|
||||
mcias-client login token --username <username> --token <token>
|
||||
#+end_src
|
||||
|
||||
*** Database Commands
|
||||
|
||||
Get database credentials:
|
||||
#+begin_src bash
|
||||
mcias-client database credentials --username <username> --token <token>
|
||||
#+end_src
|
||||
|
||||
Or use a stored token from a previous login:
|
||||
#+begin_src bash
|
||||
mcias-client database credentials --use-stored
|
||||
#+end_src
|
||||
|
||||
** Configuration
|
||||
|
||||
The client tool can be configured using command-line flags or a configuration file:
|
||||
|
||||
- `--server`: MCIAS server address (default: http://localhost:8080)
|
||||
- `--token-file`: File to store authentication token (default: $HOME/.mcias-token)
|
||||
- `--config`: Config file (default: $HOME/.mcias-client.yaml)
|
||||
|
||||
Example configuration file ($HOME/.mcias-client.yaml):
|
||||
#+begin_src yaml
|
||||
server: "http://mcias.example.com:8080"
|
||||
token-file: "/path/to/token/file"
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user