Skip to main content

Omni User Manager - Sync users and groups with Omni

Project description

Omni User Manager

A tool for synchronizing users, groups, and user attributes with Omni.

Installation

pip install omni-user-manager

Configuration

Create a .env file with your Omni API credentials:

OMNI_BASE_URL=your_omni_base_url
OMNI_API_KEY=your_omni_api_key

Usage

The package provides a command-line interface for syncing users, their group memberships, and attributes:

# Show available commands and options
omni-user-manager --help

Sync Modes

The tool supports three sync modes:

  1. Full Sync (default): Syncs both group memberships and user attributes
  2. Groups-only: Only syncs group memberships
  3. Attributes-only: Only syncs user attributes

Using JSON Source

Use this when your user and group data is in a single JSON file following the SCIM 2.0 format:

# Full sync (groups and attributes)
omni-user-manager --source json --users data/users.json

# Groups-only sync
omni-user-manager --source json --users data/users.json --mode groups

# Attributes-only sync
omni-user-manager --source json --users data/users.json --mode attributes

Example JSON format (users.json):

{
  "Resources": [
    {
      "active": true,
      "displayName": "User Name",
      "emails": [
        {
          "primary": true,
          "value": "user@example.com"
        }
      ],
      "groups": [
        {
          "display": "group-name",
          "value": "group-id"
        }
      ],
      "id": "user-id",
      "userName": "user@example.com",
      "urn:omni:params:1.0:UserAttribute": {
        "gcp_project": ["project1", "project2"],
        "axel_user": "true",
        "omni_user_timezone": "America/New_York"
      }
    }
  ]
}

Using CSV Source

Use this when your user data and group memberships are in separate CSV files:

# Full sync (groups and attributes)
omni-user-manager --source csv --users data/users.csv --groups data/groups.csv

# Groups-only sync
omni-user-manager --source csv --users data/users.csv --groups data/groups.csv --mode groups

# Attributes-only sync
omni-user-manager --source csv --users data/users.csv --groups data/groups.csv --mode attributes

Example CSV formats:

users.csv:

id,userName,displayName,active,emails,userAttributes
user-id,user@example.com,User Name,true,{"primary": true, "value": "user@example.com"},{"gcp_project": ["project1", "project2"], "axel_user": "true", "omni_user_timezone": "America/New_York"}

groups.csv:

id,name,members
group-id,group-name,["user-id-1", "user-id-2"]

Features

  • Synchronize users, their group memberships, and attributes with Omni
  • Support for both JSON and CSV data sources
  • Three sync modes: full, groups-only, and attributes-only
  • Detailed progress and error reporting
  • Only updates when changes are needed
  • Handles both adding and removing users from groups
  • Updates user attributes using SCIM PUT operations
  • Handles null values in user attributes appropriately
  • Supports both single-value and multi-value attributes

Development

To install in development mode:

git clone https://github.com/hawkfry/omni-user-manager.git
cd omni-user-manager
pip install -e .

Notes

  • User attributes are updated using SCIM PUT operations
  • Null values in user attributes are handled by removing the attribute
  • Multi-value attributes (like gcp_project) should be provided as arrays
  • Single-value attributes (like axel_user) should be provided as strings
  • The tool will only update attributes that have changed from their current values in Omni

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omni_user_manager-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omni_user_manager-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file omni_user_manager-0.1.0.tar.gz.

File metadata

  • Download URL: omni_user_manager-0.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for omni_user_manager-0.1.0.tar.gz
Algorithm Hash digest
SHA256 257915d60d0cd1c2dd59981e379439a76deb4d2ec2be3ec9d4a016f7a22f934c
MD5 917ccc2a1faed81391e2fd2762d3108e
BLAKE2b-256 bcd3a480ce956b389fb677d13b7843f186f4b8bc53153d78c0ec4e9524e98056

See more details on using hashes here.

File details

Details for the file omni_user_manager-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for omni_user_manager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eceb91bd24c86ecec8fa08602305a72fb809fd8135dc2db2e88ae90a30df7307
MD5 92fa9500077838bdb8af0e5819d6d159
BLAKE2b-256 2b0076f31ddb76a979d71873c58130ae7ebdc62e3423f2cfda7e1a4def689c5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page