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 git@github.com:Hawkfry-Group/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.1.tar.gz (16.0 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.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for omni_user_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a4e53d19d13991bd927800df021c46216ceb2739c5db7cb5effb716b26df938e
MD5 6676065b80ab9f71c1babd50e8649aa8
BLAKE2b-256 542edd245dd0b40ad38ba887ca3b3eaf8235edcc4e61e0678ba08d35af2224eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for omni_user_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85b26022a8d36de817ceda807959c65dc2a4d1be9770407371e65acdf343698f
MD5 bed79b85c7ca8c7ec292fb7cb05b0229
BLAKE2b-256 d28bec57227b6193d44cbc88bd5270c4f73aef1635f38b8eeea7e62cb3c5bbf8

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