GitXplorerGitXplorer
H

go-ldap-jwt

public
0 stars
0 forks
1 issues

Commits

List of commits on branch main.
Verified
84c98fb2baceb6eab9b8eec4fd0ac8e00b27789c

Merge pull request #2 from HaRo87/feature/init

HHaRo87 committed 4 years ago
Unverified
d53f096ccd0c1e2a6c113ad1436583b5d6f54608

finishing config

HHaRo87 committed 4 years ago
Unverified
a2e88676f5fc381e6eb25f7387f69a268d0b7546

fixing actions config

HHaRo87 committed 4 years ago
Unverified
7052d4d726207fa71a97092a9e8d03fc258b87f8

config work, documentation and coverage

HHaRo87 committed 4 years ago
Unverified
c1f7a4025cf63f5d2e5301a6666bb94076c2794e

initial setup

HHaRo87 committed 4 years ago
Verified
e7e1f7577fe9bb2b18ee1b23092d08c2f198a91a

Initial commit

HHaRo87 committed 4 years ago

README

The README file for this repository.

go-ldap-jwt

Testing Go Code codecov

go version license

A small Go library for creating JWTs based on LDAP user credentials including group checks.

⚡️ Getting started

Installation

To install go-ldap-jwt, use go get:

go get github.com/haro87/go-ldap-jwt

This will make the following packages available to you:

github.com/haro87/go-ldap-jwt/config

Usage

  1. Import the github.com/haro87/go-ldap-jwt/config and use it to retrieve the configuration:
package yours

import (
  "github.com/haro87/go-ldap-jwt/config"
)

func LoadConfig() {

  // In case you use secrets in a Docker container you can
  // provide the default secrets location via the `secrets`
  // parameter. If nothing is provided then the default:
  // `/run/secrets/` is used.
  config, err := config.GetConfig("path/to/config.yaml", "")

}

⚙️ Configuration

# ./configs/config.yaml

# Servers config
servers:
  - protocol: ldaps # defaults to ldaps if not provided
    host: some-ldap-server.com
    port: 636 # defaults to 636 if not provided
# Bind user config
# can also work with reading secrets from file
user: 
  name: testuser
  password: test1234 
# Groups config
groups:
  objectclass: user # defaults to user if not provided
  memberattribute: memberOf # defaults to memberOf if not provided
  definitions:
  - some-group
  - some-other-group
# JWT config
jwt:
  expire: 30m
  signingkey: somekey

⚠️ License

MIT © HaRo87.