Skip to main content

TU-Berlin Isis Shibboleth login library

Project description

Shisis - Shibboleth ISIS

PyPI License Code style: black

Shisis is a small library to handle authentication for TU-Berlin's Moodle instance "ISIS" via Shibboleth.

Install

pip install shisis-async

Usage

CLI

$ shisis -h
usage: shisis [-h] [-u USERNAME] [-p PASSWORD] [-t | -r]

options:
  -h, --help            show this help message and exit
  -u, --username USERNAME
                        Shibboleth username (environment: SHISIS_USER)
  -p, --password PASSWORD
                        Shibboleth password (environment: SHISIS_PASS)
  -t, --token           Only print token
  -r, --private-token   Only print private_token

Code

import asyncio

import aiohttp
from shisis import Shisis


async def main():
    async with aiohttp.ClientSession() as session:
        shisis = Shisis(session)
        tokens = await shisis.authenticate("username", "password")
        print(tokens)


asyncio.run(main())

Code with poodle_async_full

import asyncio
import os

import aiohttp
from poodle_async_full import ApiClient, Configuration, DefaultApi
from shisis import Shisis


async def main():
    configuration = Configuration(host="https://isis.tu-berlin.de")

    async with ApiClient(configuration) as client:
        poodle = DefaultApi(client)
        config = await poodle.tool_mobile_get_public_config()

        async with aiohttp.ClientSession() as shisis_client:
            shisis = Shisis(shisis_client)
            tokens = await shisis.authenticate(
                "username",
                "password",
                config,
                config.identityproviders,
            )
            configuration.api_key["wstoken"] = tokens.token

        site_info = await poodle.core_webservice_get_site_info()
        print(site_info.userid)


asyncio.run(main())

License

GPL-3.0

Contributions

Contributions are welcome.

To contribute changes, open a PR on the main branch.

[!NOTE]
Before commiting, run pip install -r requirements-dev.txt && make format && make lint and fix linting errors.

Changelog

See CHANGELOG.md

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

shisis_async-1.2.2.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

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

shisis_async-1.2.2-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file shisis_async-1.2.2.tar.gz.

File metadata

  • Download URL: shisis_async-1.2.2.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shisis_async-1.2.2.tar.gz
Algorithm Hash digest
SHA256 ac4415924f8e37b230cfa198bc26723e44febc11f17cb4f9d2a49635f392bce2
MD5 e7e9a006561906422d56b8879acc3f5c
BLAKE2b-256 22fbe4a4c1a1d635e29a5b0b7ee4f7696bfbda44ad12f678467b99ea7aee1399

See more details on using hashes here.

Provenance

The following attestation bundles were made for shisis_async-1.2.2.tar.gz:

Publisher: publish.yml on bchmnn/shisis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shisis_async-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: shisis_async-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shisis_async-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a65983ac020a76d3b416f9056fe3c4e7db64afa11e46adaf302c678c7ec2fb6f
MD5 7deb39100e0dcb56311019f6dfd15f64
BLAKE2b-256 9770877931af2fd78cb40b25f42011a1f31b39dd2dc6b9f0729239da9b8644a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for shisis_async-1.2.2-py3-none-any.whl:

Publisher: publish.yml on bchmnn/shisis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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