Skip to main content

Gets Slack tokens - wrapper around slacktokens providing a CLI entrypoint

Project description

slacktokengetter

PyPI - Version

Gets Slack tokens — wrapper around slacktokens providing a CLI entrypoint.

Usage

uvx --python=3.11 slacktokengetter

Prints Slack tokens and cookies as JSON on stdout. Example output (obviously the below token and cookie are not real):

{"tokens": {"https://WORKSPACE.slack.com/": {"token": "xoxc-1234567890123-4567890123456-78901234567890-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "name": "My Workspace"}}, "cookie": {"name": "d", "value": "xoxd-nID%2Ba1BC%2Babc1d2eFGhiJKl34MN5opQRsTU6VWxyZ7abcD8E9F0gH1ijk2LM3nOpqrs4t5UVWxyzab6cdE7FGh8ijKLm9OpqR%2BabCD123Efg45Hijk%2Bl6MNOpq7Rs89tUvWx0YZaBcd1EF%2BghI2J3KL6mNOpqRstuvw78XYZa9BCD0ef1GhIjk2lmN3OPq34r%2FsTuVWxyzABCd5efGhI6j7klmN8op%3D%3D"}}

If it fails, it will print JSON with error and traceback fields instead.

Acknowledgements

This project vendors pycookiecheat (commit fe0d6896) by Nathan Henrie, licensed under the MIT License. A copy of that license is included in this repository as vendor/pycookiecheat-LICENSE and in the distributed packages as pycookiecheat-LICENSE.

This project vendors slacktokens (commit 69d8760b) by Heath Raftery, licensed under the GNU General Public License v3 (GPLv3). A copy of that license is included in this repository as vendor/slacktokens-LICENSE and in the distributed packages as slacktokens-LICENSE.

Why the vendoring?

pycookiecheat is vendored because the latest released version (0.8.0) has broken support for the Slack app on macOS if you use the non-Mac App Store distribution of Slack; the maintainer has merged a PR to fix this issue, but hasn't yet made a new release incorporating that fix. While one could address this by using a git+ssh:// dependency, PyPI does not allow packages containing such dependencies to be uploaded. So to distribute this via PyPI, we have to vendor pycookiecheat. And that in turn forces us to vendor slacktokens, since it has the dependency on pycookiecheat.

We don't namespace/"shadow"/relocate the dependencies we vendor; as a result, you can't install this into the same environment as the unvendored slacktokens and pycookiecheat packages. However, that is not a problem, since this package is essentially an application distributed via PyPI, it is not intended to be used as a library.

Why only Python 3.11?

slacktokens uses leveldb which has not been updated since 2019, and which is broken on Python 3.12 and newer. There is a fork leveldb-312 which supports Python 3.12, and also an alternative package (plyvel) which does. However, given this is intended to be invoked using uvx, for now I decided to just make everyone use Python 3.11. If another Python app is calling this as a subprocess, it can use whichever Python version you wish. It would work with Python 3.10 too, but I decided it would be simpler to only support the latest working version.

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

slacktokengetter-0.1.12.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

slacktokengetter-0.1.12-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file slacktokengetter-0.1.12.tar.gz.

File metadata

  • Download URL: slacktokengetter-0.1.12.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for slacktokengetter-0.1.12.tar.gz
Algorithm Hash digest
SHA256 f021f0632e614b09710d255dbc24c020c8ec5db3e0cc1e451f00e3d790419a6d
MD5 a8d4c2ad93eb23dea4404a7fd3f222b6
BLAKE2b-256 e9786f565b9525c55595ca1328b4c7a5898e4d7fc65ca5a15b0aec136a02d1e0

See more details on using hashes here.

File details

Details for the file slacktokengetter-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: slacktokengetter-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for slacktokengetter-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 651c27b32bc4fe301eb557225351117bf18733afce6ba90fc60cc95379ada2b9
MD5 fec3a0a7057999976f7db306de46c46d
BLAKE2b-256 8ab54678b864fada632631908ed1c57941cd87a50382f76271ebf63724b4561a

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