diff --git a/README.md b/README.md index 536c7e3..fd49800 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,32 @@ py-aps is a Python SDK that provides a simple and intuitive interface for intera ## Quick Start ```python -from pyaps import auth - -# Coming soon - SDK implementation in progress +from pyaps.auth import AuthClient, Scopes + +# 2-legged OAuth +client = AuthClient(client_id="...", client_secret="...") +token = client.two_legged.get_token([Scopes.DATA_READ]) + +# 3-legged OAuth with PKCE +verifier, challenge = client.three_legged.generate_pkce_pair() +auth_url = client.three_legged.build_authorize_url( + scopes=[Scopes.DATA_READ, Scopes.USER_PROFILE_READ], + code_challenge=challenge +) +# After user authorizes: token = client.three_legged.exchange_code(code, code_verifier=verifier) ``` +For more examples, see `src/pyaps/auth/example.py`. + ## Project Status -This package is currently in early development (v0.0.1). The package name has been reserved on PyPI, and active development is underway by **voidbox**. +**Current version: v0.0.2** - Authentication API support added + +This package is currently in early development. Active development is underway by **voidbox**. + +### Version History +- **v0.0.2** - Added OAuth 2.0 authentication client with 2-legged/3-legged flows, PKCE support, and token management +- **v0.0.1** - Initial package release (placeholder) ## Contributing diff --git a/pyproject.toml b/pyproject.toml index 9fc236d..65ab88c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "py-aps" -version = "0.0.1" +version = "0.0.2" description = "Autodesk Platform Service APIs Python SDK" readme = "README.md" requires-python = ">=3.9" diff --git a/src/pyaps/__init__.py b/src/pyaps/__init__.py index 35df940..f86115a 100644 --- a/src/pyaps/__init__.py +++ b/src/pyaps/__init__.py @@ -1,8 +1,9 @@ # src/pyaps/__init__.py -from . import auth, automation, datamanagement +from . import auth, automation, datamanagement, http __all__ = [ "auth", "automation", - "datamanagement" + "datamanagement", + "http", ] \ No newline at end of file diff --git a/src/pyaps/auth/__init__.py b/src/pyaps/auth/__init__.py index e69de29..2ace60a 100644 --- a/src/pyaps/auth/__init__.py +++ b/src/pyaps/auth/__init__.py @@ -0,0 +1,11 @@ +# src/pyaps/auth/__init__.py +from .client import AuthClient, Scopes +from .token_store import OAuth2Token, TokenStore, InMemoryTokenStore + +__all__ = [ + "AuthClient", + "Scopes", + "OAuth2Token", + "TokenStore", + "InMemoryTokenStore", +] diff --git a/src/pyaps/http/__init__.py b/src/pyaps/http/__init__.py index e69de29..7f92c53 100644 --- a/src/pyaps/http/__init__.py +++ b/src/pyaps/http/__init__.py @@ -0,0 +1,7 @@ +# src/pyaps/http/__init__.py +from .client import HTTPClient, HTTPError + +__all__ = [ + "HTTPClient", + "HTTPError", +]