Skip to main content
 ______     __  __     ______   __  __     ______     __  __     __   __     ______
/\  __ \   /\ \/\ \   /\__  _\ /\ \_\ \   /\___  \   /\ \_\ \   /\ "-.\ \   /\  ___\
\ \  __ \  \ \ \_\ \  \/_/\ \/ \ \  __ \  \/_/  /__  \ \____ \  \ \ \-.  \  \ \ \____
 \ \_\ \_\  \ \_____\    \ \_\  \ \_\ \_\   /\_____\  \/\_____\  \ \_\\"\_\  \ \_____\
  \/_/\/_/   \/_____/     \/_/   \/_/\/_/   \/_____/   \/_____/   \/_/ \/_/   \/_____/
  • Supports LDAP & local users.

  • Follows nested groups.

  • Compatible with Python 2 and 3.

Installation

git

$ pypi install ldap3
$ git clone https://github.com/rbw0/authzync.git

pypi

$ pypi install authzync

Usage example

Perform a sync of the LDAP directory specified in authzync.json, get non-LDAP permissions from local_db.json and write results to svn_authz.txt

$ python authzync.py --config authzync.json --local_db local_db.json --authz svn_authz.txt

Configuration

Authzync config (–config) Configures LDAP, mappings, parse rules, logging etc

Local users (–local_db) Can be used to set repository permissions for users not present in the LDAP directory, i.e. local users.

How it works

  1. Authzync starts by looking for groups matching the patterns.access_pattern in ldap.base_dn

Note that there’s only one required part in the group name: repo_access (RO or RW). This tells authzync which permission to apply to members of this group.

  1. Next, the value of the attribute set in mappings.section_name is parsed according to patterns.section_pattern

  2. Finally, a list of members is fetched and the authz file generated.

Example

Authzync config

Name

Value

ldap.base_dn

ou=SVN,dc=example,dc=com

mappings.section_name

description

patterns.access_pattern

^svn_.*_(?P<repo_access>RO|RW)$

patterns.section_pattern

^(?P<repo_name>.*):(?P<repo_path>/.*)

…and…

LDAP directory

Group name

description value

Members

svn_repo1-trunk_ro

repo1:/trunk

user1, user2

svn_repo2-branches_ro

repo2:/branches

user1, user3

svn_repo1_rw

repo1:/

user3

Should result in:

[repo1:/trunk]
user1 = r
user2 = r

[repo2:/branches]
user1 = r
user3 = r

[repo1:/]
user3 = rw

Author

Created by Robert Wikman <rbw@vault13.org> in 2017

Metadata

Release files for authzync 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for authzync 0.1.8
File Size Uploaded
authzync-0.1.8.tar.gz 6.2 kB Details

Release files / authzync-0.1.8.tar.gz

Download URL authzync-0.1.8.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
baac538fa560e2b93a7963883a5d60440404f9b440d463bfa74a12975a7e60bb
BLAKE2b-256 checksum
How to use checksums
2e0a59cb2b48eafaf704b2ec60952aa9236ef9bf223b72bcfb014a51f6502707
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.8 This release

1 release file

0.1.6

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page