From 6d3e3fc010a38142a4e809e5ffe0f014e81e2890 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 18 May 2023 07:23:58 +0000 Subject: automatic import of python-stytch --- python-stytch.spec | 465 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 465 insertions(+) create mode 100644 python-stytch.spec (limited to 'python-stytch.spec') diff --git a/python-stytch.spec b/python-stytch.spec new file mode 100644 index 0000000..a0e4d7e --- /dev/null +++ b/python-stytch.spec @@ -0,0 +1,465 @@ +%global _empty_manifest_terminate_build 0 +Name: python-stytch +Version: 6.8.0 +Release: 1 +Summary: Stytch python client +License: MIT +URL: https://pypi.org/project/stytch/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ad/f1/8d3fd2d1c426949268eca77cfe9966257fd802e4dfdd4af1d1cf02ed5f88/stytch-6.8.0.tar.gz +BuildArch: noarch + + +%description +# Stytch Python Library + +The Stytch Python library makes it easy to use the Stytch user infrastructure API in Python applications. + +It pairs well with the Stytch [Web SDK](https://www.npmjs.com/package/@stytch/stytch-js) or your own custom authentication flow. + +## Requirements + +The Stytch Python library supports Python 3.7+ + +## Installation + +``` +pip install stytch +``` + +## Usage + +You can find your API credentials in the [Stytch Dashboard](https://stytch.com/dashboard/api-keys). + +This client library supports all of Stytch's live products: + +- [x] [Email Magic Links](https://stytch.com/docs/api/send-by-email) +- [x] [Embeddable Magic Links](https://stytch.com/docs/api/create-magic-link-overview) +- [x] [OAuth logins](https://stytch.com/docs/api/oauth-overview) +- [x] [SMS passcodes](https://stytch.com/docs/api/send-otp-by-sms) +- [x] [WhatsApp passcodes](https://stytch.com/docs/api/whatsapp-send) +- [x] [Email passcodes](https://stytch.com/docs/api/send-otp-by-email) +- [x] [Session Management](https://stytch.com/docs/api/sessions-overview) +- [x] [WebAuthn](https://stytch.com/docs/api/webauthn-overview) +- [x] [Time-based one-time passcodes (TOTPs)](https://stytch.com/docs/api/totps-overview) +- [x] [Crypto wallets](https://stytch.com/docs/api/crypto-wallet-overview) +- [x] [Passwords](https://stytch.com/docs/api/password-overview) + +### Example usage + +Create an API client: + +```python +import stytch + +client = stytch.Client( + project_id="project-live-c60c0abe-c25a-4472-a9ed-320c6667d317", + secret="secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=", + environment="test", +) +``` + +Send a magic link by email: + +```python +login_or_create_resp = client.magic_links.email.login_or_create( + email="sandbox@stytch.com", + login_magic_link_url="https://example.com/authenticate", + signup_magic_link_url="https://example.com/authenticate", +) +# Responses are fully-typed `pydantic` objects +print(login_or_create_resp) +``` + +Authenticate the token from the magic link: + +```python +auth_resp = client.magic_links.authenticate( + token="DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=", +) +print(auth_resp) +``` + +## Async support + +Every endpoint supports an `async` version which you can use by appending `_async` to the method name. You can use the +same `Client` object for `sync` and `async` methods. The above example of sending and authenticating an magic link can +be rewritten as: + +```python +login_or_create_resp = await client.magic_links.email.login_or_create_async( + email="sandbox@stytch.com", + login_magic_link_url="https://example.com/authenticate", + signup_magic_link_url="https://example.com/authenticate", +) +print(login_or_create_resp) + +auth_resp = await client.magic_links.authenticate( + token="DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=", +) +print(resp) +``` + +## Handling Errors + +Structured errors from the Stytch API will raise `StytchError` exceptions. You can view the details of the error through +the `.details` property of the `StytchError` exception. + +```python +from stytch.core.models import StytchError + +try: + auth_resp = await client.magic_links.authenticate_async(token="token") +except StytchError as error: + # Handle Stytch errors here + if error.details.error_type == "invalid_token": + print("Whoops! Try again?") +except Exception as error: + # Handle other errors here + pass +``` + +Learn more about errors in the [docs](https://stytch.com/docs/api/errors). + +## Documentation + +See example requests and responses for all the endpoints in the [Stytch API Reference](https://stytch.com/docs/api). + +Follow one of the [integration guides](https://stytch.com/docs/home#guides) or start with one of our [example apps](https://stytch.com/docs/home#example-apps). + +## Support + +If you've found a bug, [open an issue](https://github.com/stytchauth/stytch-python/issues/new)! + +If you have questions or want help troubleshooting, join us in [Slack](https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg) or email support@stytch.com. + +If you've found a security vulnerability, please follow our [responsible disclosure instructions](https://stytch.com/docs/security). + +## Development + +See DEVELOPMENT.md + +## Code of Conduct + +Everyone interacting in the Stytch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md). + + +%package -n python3-stytch +Summary: Stytch python client +Provides: python-stytch +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-stytch +# Stytch Python Library + +The Stytch Python library makes it easy to use the Stytch user infrastructure API in Python applications. + +It pairs well with the Stytch [Web SDK](https://www.npmjs.com/package/@stytch/stytch-js) or your own custom authentication flow. + +## Requirements + +The Stytch Python library supports Python 3.7+ + +## Installation + +``` +pip install stytch +``` + +## Usage + +You can find your API credentials in the [Stytch Dashboard](https://stytch.com/dashboard/api-keys). + +This client library supports all of Stytch's live products: + +- [x] [Email Magic Links](https://stytch.com/docs/api/send-by-email) +- [x] [Embeddable Magic Links](https://stytch.com/docs/api/create-magic-link-overview) +- [x] [OAuth logins](https://stytch.com/docs/api/oauth-overview) +- [x] [SMS passcodes](https://stytch.com/docs/api/send-otp-by-sms) +- [x] [WhatsApp passcodes](https://stytch.com/docs/api/whatsapp-send) +- [x] [Email passcodes](https://stytch.com/docs/api/send-otp-by-email) +- [x] [Session Management](https://stytch.com/docs/api/sessions-overview) +- [x] [WebAuthn](https://stytch.com/docs/api/webauthn-overview) +- [x] [Time-based one-time passcodes (TOTPs)](https://stytch.com/docs/api/totps-overview) +- [x] [Crypto wallets](https://stytch.com/docs/api/crypto-wallet-overview) +- [x] [Passwords](https://stytch.com/docs/api/password-overview) + +### Example usage + +Create an API client: + +```python +import stytch + +client = stytch.Client( + project_id="project-live-c60c0abe-c25a-4472-a9ed-320c6667d317", + secret="secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=", + environment="test", +) +``` + +Send a magic link by email: + +```python +login_or_create_resp = client.magic_links.email.login_or_create( + email="sandbox@stytch.com", + login_magic_link_url="https://example.com/authenticate", + signup_magic_link_url="https://example.com/authenticate", +) +# Responses are fully-typed `pydantic` objects +print(login_or_create_resp) +``` + +Authenticate the token from the magic link: + +```python +auth_resp = client.magic_links.authenticate( + token="DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=", +) +print(auth_resp) +``` + +## Async support + +Every endpoint supports an `async` version which you can use by appending `_async` to the method name. You can use the +same `Client` object for `sync` and `async` methods. The above example of sending and authenticating an magic link can +be rewritten as: + +```python +login_or_create_resp = await client.magic_links.email.login_or_create_async( + email="sandbox@stytch.com", + login_magic_link_url="https://example.com/authenticate", + signup_magic_link_url="https://example.com/authenticate", +) +print(login_or_create_resp) + +auth_resp = await client.magic_links.authenticate( + token="DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=", +) +print(resp) +``` + +## Handling Errors + +Structured errors from the Stytch API will raise `StytchError` exceptions. You can view the details of the error through +the `.details` property of the `StytchError` exception. + +```python +from stytch.core.models import StytchError + +try: + auth_resp = await client.magic_links.authenticate_async(token="token") +except StytchError as error: + # Handle Stytch errors here + if error.details.error_type == "invalid_token": + print("Whoops! Try again?") +except Exception as error: + # Handle other errors here + pass +``` + +Learn more about errors in the [docs](https://stytch.com/docs/api/errors). + +## Documentation + +See example requests and responses for all the endpoints in the [Stytch API Reference](https://stytch.com/docs/api). + +Follow one of the [integration guides](https://stytch.com/docs/home#guides) or start with one of our [example apps](https://stytch.com/docs/home#example-apps). + +## Support + +If you've found a bug, [open an issue](https://github.com/stytchauth/stytch-python/issues/new)! + +If you have questions or want help troubleshooting, join us in [Slack](https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg) or email support@stytch.com. + +If you've found a security vulnerability, please follow our [responsible disclosure instructions](https://stytch.com/docs/security). + +## Development + +See DEVELOPMENT.md + +## Code of Conduct + +Everyone interacting in the Stytch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md). + + +%package help +Summary: Development documents and examples for stytch +Provides: python3-stytch-doc +%description help +# Stytch Python Library + +The Stytch Python library makes it easy to use the Stytch user infrastructure API in Python applications. + +It pairs well with the Stytch [Web SDK](https://www.npmjs.com/package/@stytch/stytch-js) or your own custom authentication flow. + +## Requirements + +The Stytch Python library supports Python 3.7+ + +## Installation + +``` +pip install stytch +``` + +## Usage + +You can find your API credentials in the [Stytch Dashboard](https://stytch.com/dashboard/api-keys). + +This client library supports all of Stytch's live products: + +- [x] [Email Magic Links](https://stytch.com/docs/api/send-by-email) +- [x] [Embeddable Magic Links](https://stytch.com/docs/api/create-magic-link-overview) +- [x] [OAuth logins](https://stytch.com/docs/api/oauth-overview) +- [x] [SMS passcodes](https://stytch.com/docs/api/send-otp-by-sms) +- [x] [WhatsApp passcodes](https://stytch.com/docs/api/whatsapp-send) +- [x] [Email passcodes](https://stytch.com/docs/api/send-otp-by-email) +- [x] [Session Management](https://stytch.com/docs/api/sessions-overview) +- [x] [WebAuthn](https://stytch.com/docs/api/webauthn-overview) +- [x] [Time-based one-time passcodes (TOTPs)](https://stytch.com/docs/api/totps-overview) +- [x] [Crypto wallets](https://stytch.com/docs/api/crypto-wallet-overview) +- [x] [Passwords](https://stytch.com/docs/api/password-overview) + +### Example usage + +Create an API client: + +```python +import stytch + +client = stytch.Client( + project_id="project-live-c60c0abe-c25a-4472-a9ed-320c6667d317", + secret="secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=", + environment="test", +) +``` + +Send a magic link by email: + +```python +login_or_create_resp = client.magic_links.email.login_or_create( + email="sandbox@stytch.com", + login_magic_link_url="https://example.com/authenticate", + signup_magic_link_url="https://example.com/authenticate", +) +# Responses are fully-typed `pydantic` objects +print(login_or_create_resp) +``` + +Authenticate the token from the magic link: + +```python +auth_resp = client.magic_links.authenticate( + token="DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=", +) +print(auth_resp) +``` + +## Async support + +Every endpoint supports an `async` version which you can use by appending `_async` to the method name. You can use the +same `Client` object for `sync` and `async` methods. The above example of sending and authenticating an magic link can +be rewritten as: + +```python +login_or_create_resp = await client.magic_links.email.login_or_create_async( + email="sandbox@stytch.com", + login_magic_link_url="https://example.com/authenticate", + signup_magic_link_url="https://example.com/authenticate", +) +print(login_or_create_resp) + +auth_resp = await client.magic_links.authenticate( + token="DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=", +) +print(resp) +``` + +## Handling Errors + +Structured errors from the Stytch API will raise `StytchError` exceptions. You can view the details of the error through +the `.details` property of the `StytchError` exception. + +```python +from stytch.core.models import StytchError + +try: + auth_resp = await client.magic_links.authenticate_async(token="token") +except StytchError as error: + # Handle Stytch errors here + if error.details.error_type == "invalid_token": + print("Whoops! Try again?") +except Exception as error: + # Handle other errors here + pass +``` + +Learn more about errors in the [docs](https://stytch.com/docs/api/errors). + +## Documentation + +See example requests and responses for all the endpoints in the [Stytch API Reference](https://stytch.com/docs/api). + +Follow one of the [integration guides](https://stytch.com/docs/home#guides) or start with one of our [example apps](https://stytch.com/docs/home#example-apps). + +## Support + +If you've found a bug, [open an issue](https://github.com/stytchauth/stytch-python/issues/new)! + +If you have questions or want help troubleshooting, join us in [Slack](https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg) or email support@stytch.com. + +If you've found a security vulnerability, please follow our [responsible disclosure instructions](https://stytch.com/docs/security). + +## Development + +See DEVELOPMENT.md + +## Code of Conduct + +Everyone interacting in the Stytch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md). + + +%prep +%autosetup -n stytch-6.8.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-stytch -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu May 18 2023 Python_Bot - 6.8.0-1 +- Package Spec generated -- cgit v1.2.3