You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

githubauthlib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

githubauthlib

A library for authenticating with GitHub across different operating systems

1.0.1
pipPyPI
Maintainers
1

GitHub Authentication Library (githubauthlib)

PyPI version Python License: MIT TypeScript Version Quality Gate Status Coverage Security Rating Maintainability Rating Vulnerabilities Dependabot Status License: MIT Code style: black Downloads

A Python library for securely retrieving GitHub tokens from system keychains across different operating systems.

Features

  • Cross-platform support:
    • macOS: Uses Keychain Access
    • Windows: Uses Credential Manager
    • Linux: Uses libsecret
  • Secure token retrieval
  • Token validation
  • Comprehensive error handling
  • Logging support

Prerequisites

All Platforms

  • Python 3.6 or higher
  • Git (with credentials configured)

Linux-Specific

# Ubuntu/Debian
sudo apt-get install libsecret-tools

# Fedora
sudo dnf install libsecret

Installation

From PyPI

pip install githubauthlib

From Source

# Clone the repository
git clone https://github.com/GIALaboratory/cloud-platform-engineering.git

# Navigate to the library directory
cd cloud-platform-engineering/githubauthlib

# Install the package
pip install .

Usage

from githubauthlib import get_github_token, GitHubAuthError

try:
    token = get_github_token()
    if token:
        print("Token retrieved successfully!")
    else:
        print("No token found in system keychain")
except GitHubAuthError as e:
    print(f"Error retrieving token: {e}")

Verifying Installation

# Check installed version
pip list | grep githubauthlib

# View package details
pip show githubauthlib

Development Setup

For development, you may want to add the package directory to your PYTHONPATH. See AUXILIARY.md for detailed instructions.

Troubleshooting

  • Token Not Found

    • Verify Git credentials are properly configured
    • Check system keychain for GitHub credentials
  • Permission Issues

    • Ensure proper system keychain access
    • Verify Python has required permissions
  • Linux Issues

    • Confirm libsecret-tools is installed
    • Check D-Bus session is running

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.