Go to file
Kyle Isom 3d5fce5c44 Junie: write golangci-lint config. 2025-06-06 10:19:49 -07:00
.junie Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
api Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
cmd/mcias Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
data Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
database Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
docs Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
.gitignore get it testing 2025-05-09 17:33:01 -07:00
.golangci.yml Junie: write golangci-lint config. 2025-06-06 10:19:49 -07:00
README.org Junie: write golangci-lint config. 2025-06-06 10:19:49 -07:00
go.mod Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
go.sum Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
main.go Core implementation written with Junie. 2025-06-06 10:15:49 -07:00
schema.sql get it testing 2025-05-09 17:33:01 -07:00

README.org

MCIAS

MCIAS

MCIAS is the metacircular identity and access system, providing identity and authentication across metacircular projects.

It currently provides the following across metacircular services:

  1. User password authentication.
  2. User token authentication.
  3. Database credential authentication.

Future work should consider adding support for:

  1. TOTP (Time-based One-Time Password)
  2. Policy management for fine-grained access control.

Documentation

Comprehensive documentation is available in the docs directory:

  • Overview - Project overview, system architecture, database schema, and security considerations
  • API Documentation - API endpoints, request/response formats, error handling, and authentication flow
  • Installation and Usage Guide - Prerequisites, installation steps, running the server, and more

Quick Start

To get started with MCIAS:

  1. Initialize the database:

    go run main.go init --db ./mcias.db
  2. Start the server:

    go run main.go server --db ./mcias.db
  3. The server will listen on port 8080 by default.

CLI Commands

MCIAS provides a command-line interface with the following commands:

Server Command

Start the MCIAS server:

go run main.go server [--db <path>] [--addr <address>]

Init Command

Initialize the database:

go run main.go init [--db <path>]

User Commands

Add a new user:

go run main.go user add --username <username> --password <password>

List all users:

go run main.go user list

Token Commands

Add a new token for a user:

go run main.go token add --username <username> [--duration <hours>]

List all tokens:

go run main.go token list

API Overview

Authentication Endpoints

/v1/login/password

Password-based authentication endpoint.

/v1/login/token

Token-based authentication endpoint.

/v1/credentials/database

Database credential authentication endpoint (not yet fully implemented).

Request Format

The general datastructure used to log in should look like:

{
    "version": "v1",
    "login": {
        "user": "username",
        "password": "secret password",
        "token": "1234567890",
        "totp": "123456"
    }
}

Any fields that aren't used should be omitted. The version and login.user types are required, as well as the appropriate credential field.

Development

  • Run tests: go test ./...
  • Run linter: golangci-lint run
  • Run specific linter: golangci-lint run --disable-all --enable=gosec

The project uses a strict golangci-lint configuration defined in .golangci.yml. This configuration includes a comprehensive set of linters focused on:

  • Security best practices
  • Code quality and maintainability
  • Performance considerations
  • Error handling correctness

See the Installation and Usage Guide for more details.