Metadata-Version: 2.1
Name: vws-auth-tools
Version: 2024.7.12
Summary: Authentication and authorization tools for interacting with the Vuforia Web Services (VWS) API.
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License: MIT License
        
        Copyright (c) 2019 Adam Dangoor
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Source, https://github.com/VWS-Python/vws-auth-tools
Keywords: vuforia,vws
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: actionlint-py==1.7.1.15; extra == "dev"
Requires-Dist: check-manifest==0.49; extra == "dev"
Requires-Dist: deptry==0.16.2; extra == "dev"
Requires-Dist: doc8==1.1.1; extra == "dev"
Requires-Dist: freezegun==1.5.1; extra == "dev"
Requires-Dist: furo==2024.5.6; extra == "dev"
Requires-Dist: interrogate==1.7.0; extra == "dev"
Requires-Dist: mypy==1.10.1; extra == "dev"
Requires-Dist: pre-commit==3.7.1; extra == "dev"
Requires-Dist: pylint==3.2.5; extra == "dev"
Requires-Dist: pyproject-fmt==2.1.4; extra == "dev"
Requires-Dist: pyright==1.1.371; extra == "dev"
Requires-Dist: pyroma==4.2; extra == "dev"
Requires-Dist: pytest==8.2.2; extra == "dev"
Requires-Dist: pytest-cov==5.0.0; extra == "dev"
Requires-Dist: ruff==0.5.1; extra == "dev"
Requires-Dist: sphinx==7.3.7; extra == "dev"
Requires-Dist: sphinx-prompt==1.8; extra == "dev"
Requires-Dist: sphinx-substitution-extensions==2024.2.25; extra == "dev"
Requires-Dist: sphinxcontrib-spelling==8; extra == "dev"
Requires-Dist: sybil==6.1.1; extra == "dev"
Requires-Dist: vulture==2.11; extra == "dev"
Requires-Dist: vws-python-mock==2024.7.2.1; extra == "dev"

|Build Status| |codecov| |PyPI| |Documentation Status|

VWS Auth Tools
==============

Authentication and authorization tools for interacting with the Vuforia Web Services (VWS) API.

Installation
------------

.. code:: sh

   pip install vws-auth-tools

This is tested on Python 3.12+.

Usage
-----

.. invisible-code-block: python

   from mock_vws import MockVWS
   from mock_vws.database import VuforiaDatabase

   mock = MockVWS(real_http=False)
   database = VuforiaDatabase(
       server_access_key='my_access_key',
       server_secret_key='my_secret_key',
       client_access_key='my_access_key',
       client_secret_key='my_secret_key',
   )
   mock.add_database(database=database)
   mock.__enter__()

.. code-block:: python

   from urllib.parse import urljoin

   import requests
   from vws_auth_tools import authorization_header, rfc_1123_date

   request_path = '/targets'
   content = b''
   method = 'GET'
   date = rfc_1123_date()
   authorization_header = authorization_header(
       access_key='my_access_key',
       secret_key='my_secret_key',
       method=method,
       content=content,
       content_type='',
       date=date,
       request_path=request_path,
   )

   headers = {'Authorization': authorization_header, 'Date': date}

   response = requests.request(
        method=method,
        url=urljoin(base='https://vws.vuforia.com', url=request_path),
        headers=headers,
        data=content,
    )

   assert response.status_code == 200, response.text

.. invisible-code-block: python

   mock.__exit__()

Full Documentation
------------------

See the `full documentation <https://vws-auth-tools.readthedocs.io/en/latest>`__.

.. |Build Status| image:: https://github.com/VWS-Python/vws-auth-tools/workflows/CI/badge.svg
   :target: https://github.com/VWS-Python/vws-auth-tools/actions
.. |codecov| image:: https://codecov.io/gh/VWS-Python/vws-auth-tools/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/VWS-Python/vws-auth-tools
.. |Documentation Status| image:: https://readthedocs.org/projects/vws-auth-tools/badge/?version=latest
   :target: https://vws-auth-tools.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status
.. |PyPI| image:: https://badge.fury.io/py/VWS-Auth-Tools.svg
   :target: https://badge.fury.io/py/VWS-Auth-Tools
