MCPcopy
hub / github.com/glauth/glauth

github.com/glauth/glauth @GLAuth-v2.5.0 sqlite

repository ↗ · DeepWiki ↗ · release GLAuth-v2.5.0 ↗
435 symbols 1,196 edges 42 files 99 documented · 23%
README

GLAuth: LDAP authentication server for developers

Official GLAuth Website kittens dns wing vpn

Go-lang LDAP Authentication (GLAuth) is a secure, easy-to-use, LDAP server w/ configurable backends.

GitHub all releases Docker pulls GitHub last commit (branch)

  • Centrally manage accounts across your infrastructure
  • Centrally manage SSH keys, Linux accounts, and passwords for cloud servers.
  • Lightweight alternative to OpenLDAP and Active Directory for development, or a homelab.
  • Store your user directory in a file, local or in S3; SQL database; or proxy to existing LDAP servers.
  • Two Factor Authentication (transparent to applications)
  • Multiple backends can be chained to inject features

Use it to centralize account management across your Linux servers, your OSX machines, and your support applications (Jenkins, Apache/Nginx, Graylog2, and many more!).

Contributing

  • Please base all Pull Requests on dev, not master.
  • Format your code autonmatically using gofmt -d ./ before committing

Quickstart

This quickstart is a great way to try out GLAuth in a non-production environment. Be warned that you should take the extra steps to setup SSL (TLS) for production use!

  1. Download a precompiled binary from the releases page.
  2. Download the example config file.
  3. Start the GLAuth server, referencing the path to the desired config file with -c.
  4. ./glauth64 -c sample-simple.cfg
  5. Test with traditional LDAP tools
  6. For example: ldapsearch -LLL -H ldap://localhost:3893 -D cn=serviceuser,ou=svcaccts,dc=glauth,dc=com -w mysecret -x -bdc=glauth,dc=com cn=hackers

Make Commands

Note - makefile uses git data to inject build-time variables. For best results, run in the context of the git repo.

Documentation

:point_right: The latest version of GLauth's documentation is available at https://glauth.github.io/ :point_left:


Quickstart

Get started in three short steps

Usage:

glauth: securely expose your LDAP for external auth

Usage:
  glauth [options] -c <file|s3url>
  glauth -h --help
  glauth --version

Options:
  -c, --config <file>       Config file.
  -K <aws_key_id>           AWS Key ID.
  -S <aws_secret_key>       AWS Secret Key.
  -r <aws_region>           AWS Region [default: us-east-1].
  --ldap <address>          Listen address for the LDAP server.
  --ldaps <address>         Listen address for the LDAPS server.
  --ldaps-cert <cert-file>  Path to cert file for the LDAPS server.
  --ldaps-key <key-file>    Path to key file for the LDAPS server.
  -h, --help                Show this screen.
  --version                 Show version.

Configuration:

GLAuth can be deployed as a single server using only a local configuration file. This is great for testing, or for production if you use a tool like Puppet/Chef/Ansible:

glauth -c glauth.cfg

Here's a sample config wth hardcoded users and groups:

[backend]
  datastore = "config"
  baseDN = "dc=glauth,dc=com"
[[users]]
  name = "hackers"
  uidnumber = 5001
  primarygroup = 5501
  passsha256 = "6478579e37aff45f013e14eeb30b3cc56c72ccdc310123bcdf53e0333e3f416a"   # dogood
  sshkeys = [ "ssh-dss AAAAB3..." ]
[[users]]
  name = "uberhackers"
  uidnumber = 5006
  primarygroup = 5501
  passbcrypt = "243261243130244B62463462656F7265504F762E794F324957746D656541326B4B46596275674A79336A476845764B616D65446169784E41384F4432"   # dogood
[[groups]]
  name = "superheros"
  gidnumber = 5501

More configuration options are documented here and in this sample file

Backends:

For advanced users, GLAuth supports pluggable backends. Currently, it can use a local file, S3 or an existing LDAP infrastructure. Through the use of optional plugins, you can connect SQL databases, PAM, and other datastores.

[backend]
  datastore = "ldap"
  servers = [ "ldaps://server1:636", "ldaps://server2:636" ]

Stargazers over time

Stargazers over time

Extension points exported contracts — how you extend this code

HelperMaker (Interface)
(no doc) [4 implementers]
v2/pkg/handler/handler.go
MonitorInterface (Interface)
(no doc) [1 implementers]
v2/internal/monitoring/interfaces.go
Option (FuncType)
Option defines a single option function.
v2/pkg/frontend/options.go
LDAPServerInterface (Interface)
(no doc)
v2/internal/monitoring/interfaces.go
Option (FuncType)
Option defines a single option function.
v2/pkg/server/options.go
UserAuthenticator (FuncType)
UserAuthenticator authenticates a user via custom auth from a backend
v2/pkg/config/config.go
Option (FuncType)
Option defines a single option function.
v2/pkg/handler/options.go

Core symbols most depended-on inside this repo

Start
called by 60
v2/internal/tracing/tracer.go
GetLog
called by 37
v2/pkg/handler/ldapopshelper.go
Add
called by 31
v2/pkg/handler/ldap.go
String
called by 30
v2/pkg/stats/stringer.go
SetResponseTimeMetric
called by 15
v2/internal/monitoring/interfaces.go
GetBackend
called by 11
v2/pkg/handler/ldapopshelper.go
SetLDAPMetric
called by 8
v2/internal/monitoring/interfaces.go
Add
called by 6
v2/pkg/handler/owncloud.go

Shape

Function 250
Method 130
Struct 43
Interface 6
FuncType 4
TypeAlias 2

Languages

Go61%
TypeScript39%

Modules by API surface

v2/pkg/assets/js/jquery.min.js75 symbols
v2/pkg/assets/js/moment-with-locales.min.js72 symbols
v2/pkg/plugins/basesqlhandler.go34 symbols
v2/pkg/handler/ldapopshelper.go33 symbols
v2/pkg/handler/ldap.go20 symbols
v2/pkg/handler/config.go20 symbols
v2/pkg/handler/owncloud.go19 symbols
v2/pkg/handler/options.go14 symbols
v2/pkg/config/config.go13 symbols
v2/pkg/assets/js/handlebars.min.js13 symbols
v2/glauth_test.go11 symbols
v2/pkg/server/options.go10 symbols

Dependencies from manifests, versioned

github.com/GeertJohan/yubigov0.0.0-2019091712243 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/boombuler/barcodev1.0.1-0.20190219062 · 1×
github.com/cespare/xxhash/v2v2.2.0 · 1×
github.com/docopt/docopt-gov0.0.0-2018011123173 · 1×
github.com/fsnotify/fsnotifyv1.7.0 · 1×
github.com/glauth/ldapv0.0.0-2024041917152 · 1×
github.com/go-asn1-ber/asn1-berv1.5.5 · 1×
github.com/go-logr/logrv1.3.0 · 1×

For agents

$ claude mcp add glauth \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact