Categorygithub.com/phc-dm/auth-poisson
modulepackage
0.0.0-20211216134010-2928cdea45cf
Repository: https://github.com/phc-dm/auth-poisson.git
Documentation: pkg.go.dev

# README

auth-poisson

Servizio di autenticazione attraverso LDAP

Interfaccia

  • POST /login

    { 
        "username": "<username>", 
        "password": "<password>" 
    }
    

    Controlla le cretenziali dell'utente <username> siano <password> e ritorna un token identificativo per richieste successive (se un token è già associato all'utente ne crea uno nuovo).

  • POST /logout

    { "token": "<token>" }
    

    Distrugge il token dell'utente <username> o eventualmente dell'utente associato a <token>.

  • GET /token?username=<username>

    Ritorna il token associato all'utente

  • GET /users

    Ritorna una lista degli utenti con tutte le informazioni pubbliche fornite da LDAP.

  • GET /users?username=<username>

    Ritorna tutte le informazioni pubbliche dell'utente <username> fornite da LDAP.

  • TODO POST /update

    {
        // A valid token for the given user  
        "token": "<token>",
        // Name of the property to change  
        "property": "<email | ...>",
        // New value to set
        "value": "<value>"
    }
    

    Cambia la proprietà <property> dell'utente associato a <token> con il nuovo valore fornito.

  • TODO POST /change-password

    {
        // A valid token for the given user  
        "token": "<token>",
        // New password
        "password": "<new-password>",
    }
    

    Cambia la password dell'utente associato a <token> con <new-password>

  • GET /debug

    Logga informazioni di debug sulle sessioni correnti.

# Packages

No description provided by the author

# Functions

GenerateRandomString ...
NewAuthenticationService ...

# Structs

LoginRequest rappresenta una richiesta di autenticazione in JSON.
Service è l'intero servizio di autenticazione, contiene i dati per connettersi con ldap ed il server http.
Session rappresenta una sessione di un utente associata al servizio di autenticazione, è salvata in memoria quindi l'utente dovrà ottenere un nuovo token in caso di riavvio.
UpdateUserPropertyRequest rappresenta una richiesta di cambio di attributo su ldap.

# Type aliases

Token è un alias che rappresenta un token di accesso collegato ad una sessione.