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.1.tar.gz (43.9 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.1-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shisis_async-1.2.1.tar.gz
  • Upload date:
  • Size: 43.9 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.1.tar.gz
Algorithm Hash digest
SHA256 3fab813ba3059bd491d04bfc9e46694fd0fe8b91d322f028931f23d7b9947bd1
MD5 98694166e594284f2d37ec4241b801d4
BLAKE2b-256 3ee823020f034127b2ddd5be35439de08cd0ad676702739cb7eacd6b26f3bb58

See more details on using hashes here.

Provenance

The following attestation bundles were made for shisis_async-1.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: shisis_async-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b50f19b55c07ae14adabfee1e59d0b9cc4078e1f088c43a2db9473356e660c8
MD5 09712ec0633f00aab781efd8a0235611
BLAKE2b-256 27eb3e24a60d489eda2eb210e7273fb16ad06a1ac0d38f8cd8a8dfccab2aa2a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for shisis_async-1.2.1-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