Skip to main content

Base Authentication Library for VOLTTRON

Project description

volttron-lib-auth

Prototype authentication classes for volttron authentication, authorization and auth service.

Prerequisites

  • Python 3.8
  • Poetry

Python

volttron-lib-auth requires Python 3.8 or above.

To install Python 3.8, we recommend using pyenv.

# install pyenv
git clone https://github.com/pyenv/pyenv ~/.pyenv

# setup pyenv (you should also put these three lines in .bashrc or similar)
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"

# install Python 3.8
pyenv install 3.8.10

# make it available globally
pyenv global system 3.8.10

Poetry

This project uses poetry to install and manage dependencies. To install poetry, follow these instructions.

Installation and Virtual Environment Setup

Set the environment to be in your project directory:

poetry config virtualenvs.in-project true

If you want to install all your dependencies, including dependencies to help with developing your agent, run this command:

poetry install

If you want to install only the dependencies needed to run your agent, run this command:

poetry install --no-dev

Activate the virtual environment:

poetry shell

Git Setup

  1. To use git to manage version control, create a new git repository in your local agent project.
git init
  1. Then create a new repo in your Github or Gitlab account. Copy the URL that points to that new repo in your Github or Gitlab account. This will be known as our 'remote'.

  2. Add the remote (i.e. the new repo URL from your Github or Gitlab account) to your local repository. Run the following command:

git remote add origin <my github/gitlab URL>

When you push to your repo, note that the default branch is called 'main'.

Publishing to PyPi

Publishing your Agent module to PyPi is automated through the continuous integration workflow provided in ~/.github/workflows/publish_to_pypi.yml. You can update that Github Workflow with your credentials to ensure that publishing to PyPi will succeed. The default behavior of that workflow is to publish to PyPi when a release has been published. If you want to change this behavior, you can modify the workflow to publish to PyPi based on whatever desired event; see Github Workflows docs on how to change the events that trigger a workflow.

Optional Configurations

Precommit

Install pre-commit hooks:

pre-commit install

To run pre-commit on all your files, run this command:

pre-commit run --all-files

If you have precommit installed and you want to ignore running the commit hooks every time you run a commit, include the --no-verify flag in your commit. The following is an example:

git commit -m "Some message" --no-verify

Documentation

To build the docs, navigate to the 'docs' directory and build the documentation:

cd docs
make html

After the documentation is built, view the documentation in html form in your browser. The html files will be located in ~<path to agent project directory>/docs/build/html.

PROTIP: To open the landing page of your documentation directly from the command line, run the following command:

open <path to agent project directory>/docs/build/html/index.html

This will open the documentation landing page in your default browsert (e.g. Chrome, Firefox).

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

volttron_lib_auth-2.0.0rc3.tar.gz (94.9 kB view details)

Uploaded Source

Built Distribution

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

volttron_lib_auth-2.0.0rc3-py3-none-any.whl (95.9 kB view details)

Uploaded Python 3

File details

Details for the file volttron_lib_auth-2.0.0rc3.tar.gz.

File metadata

  • Download URL: volttron_lib_auth-2.0.0rc3.tar.gz
  • Upload date:
  • Size: 94.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.18 Linux/6.8.0-1029-azure

File hashes

Hashes for volttron_lib_auth-2.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 a73f14c0b6531450018f2c09d9e6af9c35b3350a9fdb95247a4bf4ab8fb5893d
MD5 9825debb02e147368c342957c7ec4fd0
BLAKE2b-256 d6dd16f8eb7db90ad7fd274b58808b06e16141c48777fe875e4281158a4225e5

See more details on using hashes here.

File details

Details for the file volttron_lib_auth-2.0.0rc3-py3-none-any.whl.

File metadata

  • Download URL: volttron_lib_auth-2.0.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 95.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.18 Linux/6.8.0-1029-azure

File hashes

Hashes for volttron_lib_auth-2.0.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 f5912b7d36980d36c2d7942f45408678afb2c6d0fc2cffd14112e88a223cee1d
MD5 a145da3e1ef4c1c3d6441707a5a8ecad
BLAKE2b-256 8c709898c6c5817ecd4c90bfb6406a59599dfd769f0a25ee2a0bbd1a3b3a7183

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