authentication

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2025 License: AGPL-3.0 Imports: 0 Imported by: 0

README

Authentication service

Authentication service for A-Novel apps.

GitHub Actions Workflow Status codecov Go Report Card

GitHub go.mod Go version GitHub repo file or directory count GitHub code size in bytes

Coverage graph

This is a quickstart document to test the project locally.

You can find the API documentation on the repository github page.

Want to contribute? Check the contribution guidelines.

Run locally

Pre-requisites

  • Golang
  • Podman
  • Make
    # Debian / Ubuntu
    sudo apt-get install build-essential
    
    # macOS
    brew install make
    
    For Windows, you can use Make for Windows

Setup environment

Create a .envrc file from the template:

cp .envrc.template .envrc

Then fill the missing secret variables. Once your file is ready:

source .envrc

You may use tools such as direnv, otherwise you'll need to source the env file on each new terminal session.

Generate keys

You need to do this at least once, to have a set of keys ready to use for authentication.

It is recommended to run this regularly, otherwise keys will expire and authentication will fail.

make rotate_keys
# 9:07PM INF key generated app=authentication job=rotate-keys key_id=... usage=auth
# 9:07PM INF no key generated app=authentication job=rotate-keys usage=refresh
# 9:07PM INF rotation done app=authentication failed_keys=0 generated_keys=1 job=rotate-keys total_keys=2

Et Voilà!

make api
# 3:09PM INF starting application... app=authentication
# 3:09PM INF application started! address=:4001 app=authentication

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
codegen
Code generated by ogen, DO NOT EDIT.
Code generated by ogen, DO NOT EDIT.
cmd
api command
rotatekeys command
internal
dao
Package dao (Data-Oriented Object) contains interfaces used to interact with a data source (database, filesystem, etc.)
Package dao (Data-Oriented Object) contains interfaces used to interact with a data source (database, filesystem, etc.)
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL