summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-passage-identity.spec786
-rw-r--r--sources1
3 files changed, 788 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..f2a3488 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/passage-identity-2.1.2.tar.gz
diff --git a/python-passage-identity.spec b/python-passage-identity.spec
new file mode 100644
index 0000000..afa68a3
--- /dev/null
+++ b/python-passage-identity.spec
@@ -0,0 +1,786 @@
+%global _empty_manifest_terminate_build 0
+Name: python-passage-identity
+Version: 2.1.2
+Release: 1
+Summary: Python library to help manage your Passage application and users
+License: MIT License
+URL: https://github.com/passageidentity/passage-python
+Source0: https://mirrors.aliyun.com/pypi/web/packages/6f/0a/188d30b47f8fef08a91616081123a43dbc3fa71e58bd59078229165e08b5/passage-identity-2.1.2.tar.gz
+BuildArch: noarch
+
+Requires: python3-pyjwt
+Requires: python3-cryptography
+Requires: python3-requests
+Requires: python3-Flask
+Requires: python3-django
+Requires: python3-importlib-metadata
+
+%description
+<img src="https://storage.googleapis.com/passage-docs/passage-logo-gradient.svg" alt="Passage logo" style="width:250px;"/>
+
+[![PyPI version](https://badge.fury.io/py/passage-identity.svg)](https://badge.fury.io/py/passage-identity)
+# passage-python
+
+This Python SDK allows for verification of server-side authentication for applications using [Passage](https://passage.id)
+
+Install this package using [pip](https://pypi.org/project/passage-identity/).
+
+```
+pip install passage-identity
+```
+
+## Instantiating the Passage Class
+
+Passage has three arguments that can be used for initialization: `app_id`, `api_key`, and `auth_strategy`.
+
+- `app_id` is the Passage App ID that specifies which app should be authorized. It has no default value and must to be set upon initialization.
+- `api_key` is an API key for the Passage app, which can be generated in the 'App Settings' section of the [Passage Console](https://console.passage.id). It is an optional parameter and not required for authenticating requests. It is required to get or update user information.
+- `auth_strategy` defines where the Passage SDK should look for the authentication token. It is set by default to `Passage.COOKIE_AUTH`, but can be changed to `Passage.HEADER_AUTH`.
+
+## Authenticating a Request
+
+To authenticate an HTTP request in a Flask application, you can use the Passage library in a middleware function.
+You need to provide Passage with your app ID in order to verify the JWTs.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID_ = os.environ.get("PASSAGE_APP_ID")
+
+def exampleFlaskMiddleware(request):
+ psg = Passage(PASSAGE_APP_ID)
+ user = psg.authenticateRequest(request)
+```
+## Retrieve App Info
+
+To retrieve information about an app , you should use the `getApp` method.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID_ = os.environ.get("PASSAGE_APP_ID")
+
+psg = Passage(PASSAGE_APP_ID)
+app_info = psg.getApp()
+```
+
+The information available in the Passage App object is as
+
+| Field | Type |
+| ------------------------------- | ---------------------- |
+| name | string |
+| id | string |
+| auth_origin | string |
+| redirect_url | string |
+| login_url | string |
+| rsa_public_key | boolean |
+| allowed_identifier | string |
+| require_identifier_verification | boolean |
+| session_timeout_length | int |
+| user_metadata_schema | list |
+| layouts | list |
+
+## Retrieve User Info
+
+To retrieve information about a user, you should use the `getPassageUser` method. You will need to use a Passage API key, which can be created in the Passage Console under your Application Settings. This API key grants your web server access to the Passage management APIs to get and update information about users.
+This API key must be protected and stored in an appropriate secure storage location. It should never be hard-coded in the repository.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+def exampleFlaskMiddleware(request):
+ g.user = psg.authenticateRequest(request)
+
+@auth.route('/home')
+def authenticatedEndpoint():
+ user = psg.getPassageUser(g.user)
+ print(user.email)
+```
+
+The information available in the Passage User object is as
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| id | string |
+| email | string |
+| phone | string |
+| status | string |
+| email_verified | boolean |
+| phone_verified | boolean |
+| created_at | Datetime |
+| last_login_at | Datetime |
+| webauthn | boolean |
+| webauthn_devices | array |
+| recent_events | array of PassageEvents |
+
+## Activate/Deactivate User
+
+You can also activate or deactivate a user using the Passage SDK. These actions require an API Key and deactivating a user will prevent them from logging into your application
+with Passage.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+#activate or deactivate this user
+psg.deactivateUser(user_id)
+```
+
+## Update User Attributes
+
+You can also update a user's attributes using the Passage SDK. This will require a Passage API Key.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# update a user (note that user_metadata is optional)
+psg.updateUser(user_id, {
+ "email": "newEmail@domain.com",
+ "phone": "+15005550006",
+ "user_metadata": {
+ "example1": "example metadata"
+ }
+})
+```
+
+## Create User
+
+You can also create users using their email address or phone number. Note that their phone number must be in E164 format (example shown below).
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# create a user via their email (note that user_metadata is optional)
+psg.createUser({
+ "email": "exampleEmail@domain.com",
+ "user_metadata": {
+ "example1": "example metadata"
+ }
+})
+
+# create a user via their phone number
+psg.createUser({"phone": "+15005550007"})
+```
+
+## Delete User
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# delete a user via their userID
+deleted_user = psg.deleteUser(user_id)
+if deleted_user:
+ print("User has been deleted")
+```
+
+## Create an Embeddable Magic Link
+
+To create a magic link, you should use the `createMagicLink` method. The method takes in `MagicLinkAttributes`, which is in this structure:
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| user_id | string |
+| email | string |
+| phone | string |
+| channel | ChannelType |
+| send | boolean |
+| magic_link_path | string |
+| redirect_url | string |
+
+The information it returns is in a PassageMagicLink object with this structure:
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| id | string |
+| secret | string |
+| activated | boolean |
+| user_id | string |
+| app_id | string |
+| identifier | string |
+| type | Datetime |
+| webauthn | boolean |
+| webauthn_devices | array |
+| recent_events | array of PassageEvents |
+
+```python
+
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# create a magic link
+magicLink = psg.createMagicLink(magicLinkAttributes={"email": "<example@email.com>", "channel": "email"})
+```
+
+
+%package -n python3-passage-identity
+Summary: Python library to help manage your Passage application and users
+Provides: python-passage-identity
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-passage-identity
+<img src="https://storage.googleapis.com/passage-docs/passage-logo-gradient.svg" alt="Passage logo" style="width:250px;"/>
+
+[![PyPI version](https://badge.fury.io/py/passage-identity.svg)](https://badge.fury.io/py/passage-identity)
+# passage-python
+
+This Python SDK allows for verification of server-side authentication for applications using [Passage](https://passage.id)
+
+Install this package using [pip](https://pypi.org/project/passage-identity/).
+
+```
+pip install passage-identity
+```
+
+## Instantiating the Passage Class
+
+Passage has three arguments that can be used for initialization: `app_id`, `api_key`, and `auth_strategy`.
+
+- `app_id` is the Passage App ID that specifies which app should be authorized. It has no default value and must to be set upon initialization.
+- `api_key` is an API key for the Passage app, which can be generated in the 'App Settings' section of the [Passage Console](https://console.passage.id). It is an optional parameter and not required for authenticating requests. It is required to get or update user information.
+- `auth_strategy` defines where the Passage SDK should look for the authentication token. It is set by default to `Passage.COOKIE_AUTH`, but can be changed to `Passage.HEADER_AUTH`.
+
+## Authenticating a Request
+
+To authenticate an HTTP request in a Flask application, you can use the Passage library in a middleware function.
+You need to provide Passage with your app ID in order to verify the JWTs.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID_ = os.environ.get("PASSAGE_APP_ID")
+
+def exampleFlaskMiddleware(request):
+ psg = Passage(PASSAGE_APP_ID)
+ user = psg.authenticateRequest(request)
+```
+## Retrieve App Info
+
+To retrieve information about an app , you should use the `getApp` method.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID_ = os.environ.get("PASSAGE_APP_ID")
+
+psg = Passage(PASSAGE_APP_ID)
+app_info = psg.getApp()
+```
+
+The information available in the Passage App object is as
+
+| Field | Type |
+| ------------------------------- | ---------------------- |
+| name | string |
+| id | string |
+| auth_origin | string |
+| redirect_url | string |
+| login_url | string |
+| rsa_public_key | boolean |
+| allowed_identifier | string |
+| require_identifier_verification | boolean |
+| session_timeout_length | int |
+| user_metadata_schema | list |
+| layouts | list |
+
+## Retrieve User Info
+
+To retrieve information about a user, you should use the `getPassageUser` method. You will need to use a Passage API key, which can be created in the Passage Console under your Application Settings. This API key grants your web server access to the Passage management APIs to get and update information about users.
+This API key must be protected and stored in an appropriate secure storage location. It should never be hard-coded in the repository.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+def exampleFlaskMiddleware(request):
+ g.user = psg.authenticateRequest(request)
+
+@auth.route('/home')
+def authenticatedEndpoint():
+ user = psg.getPassageUser(g.user)
+ print(user.email)
+```
+
+The information available in the Passage User object is as
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| id | string |
+| email | string |
+| phone | string |
+| status | string |
+| email_verified | boolean |
+| phone_verified | boolean |
+| created_at | Datetime |
+| last_login_at | Datetime |
+| webauthn | boolean |
+| webauthn_devices | array |
+| recent_events | array of PassageEvents |
+
+## Activate/Deactivate User
+
+You can also activate or deactivate a user using the Passage SDK. These actions require an API Key and deactivating a user will prevent them from logging into your application
+with Passage.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+#activate or deactivate this user
+psg.deactivateUser(user_id)
+```
+
+## Update User Attributes
+
+You can also update a user's attributes using the Passage SDK. This will require a Passage API Key.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# update a user (note that user_metadata is optional)
+psg.updateUser(user_id, {
+ "email": "newEmail@domain.com",
+ "phone": "+15005550006",
+ "user_metadata": {
+ "example1": "example metadata"
+ }
+})
+```
+
+## Create User
+
+You can also create users using their email address or phone number. Note that their phone number must be in E164 format (example shown below).
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# create a user via their email (note that user_metadata is optional)
+psg.createUser({
+ "email": "exampleEmail@domain.com",
+ "user_metadata": {
+ "example1": "example metadata"
+ }
+})
+
+# create a user via their phone number
+psg.createUser({"phone": "+15005550007"})
+```
+
+## Delete User
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# delete a user via their userID
+deleted_user = psg.deleteUser(user_id)
+if deleted_user:
+ print("User has been deleted")
+```
+
+## Create an Embeddable Magic Link
+
+To create a magic link, you should use the `createMagicLink` method. The method takes in `MagicLinkAttributes`, which is in this structure:
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| user_id | string |
+| email | string |
+| phone | string |
+| channel | ChannelType |
+| send | boolean |
+| magic_link_path | string |
+| redirect_url | string |
+
+The information it returns is in a PassageMagicLink object with this structure:
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| id | string |
+| secret | string |
+| activated | boolean |
+| user_id | string |
+| app_id | string |
+| identifier | string |
+| type | Datetime |
+| webauthn | boolean |
+| webauthn_devices | array |
+| recent_events | array of PassageEvents |
+
+```python
+
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# create a magic link
+magicLink = psg.createMagicLink(magicLinkAttributes={"email": "<example@email.com>", "channel": "email"})
+```
+
+
+%package help
+Summary: Development documents and examples for passage-identity
+Provides: python3-passage-identity-doc
+%description help
+<img src="https://storage.googleapis.com/passage-docs/passage-logo-gradient.svg" alt="Passage logo" style="width:250px;"/>
+
+[![PyPI version](https://badge.fury.io/py/passage-identity.svg)](https://badge.fury.io/py/passage-identity)
+# passage-python
+
+This Python SDK allows for verification of server-side authentication for applications using [Passage](https://passage.id)
+
+Install this package using [pip](https://pypi.org/project/passage-identity/).
+
+```
+pip install passage-identity
+```
+
+## Instantiating the Passage Class
+
+Passage has three arguments that can be used for initialization: `app_id`, `api_key`, and `auth_strategy`.
+
+- `app_id` is the Passage App ID that specifies which app should be authorized. It has no default value and must to be set upon initialization.
+- `api_key` is an API key for the Passage app, which can be generated in the 'App Settings' section of the [Passage Console](https://console.passage.id). It is an optional parameter and not required for authenticating requests. It is required to get or update user information.
+- `auth_strategy` defines where the Passage SDK should look for the authentication token. It is set by default to `Passage.COOKIE_AUTH`, but can be changed to `Passage.HEADER_AUTH`.
+
+## Authenticating a Request
+
+To authenticate an HTTP request in a Flask application, you can use the Passage library in a middleware function.
+You need to provide Passage with your app ID in order to verify the JWTs.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID_ = os.environ.get("PASSAGE_APP_ID")
+
+def exampleFlaskMiddleware(request):
+ psg = Passage(PASSAGE_APP_ID)
+ user = psg.authenticateRequest(request)
+```
+## Retrieve App Info
+
+To retrieve information about an app , you should use the `getApp` method.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID_ = os.environ.get("PASSAGE_APP_ID")
+
+psg = Passage(PASSAGE_APP_ID)
+app_info = psg.getApp()
+```
+
+The information available in the Passage App object is as
+
+| Field | Type |
+| ------------------------------- | ---------------------- |
+| name | string |
+| id | string |
+| auth_origin | string |
+| redirect_url | string |
+| login_url | string |
+| rsa_public_key | boolean |
+| allowed_identifier | string |
+| require_identifier_verification | boolean |
+| session_timeout_length | int |
+| user_metadata_schema | list |
+| layouts | list |
+
+## Retrieve User Info
+
+To retrieve information about a user, you should use the `getPassageUser` method. You will need to use a Passage API key, which can be created in the Passage Console under your Application Settings. This API key grants your web server access to the Passage management APIs to get and update information about users.
+This API key must be protected and stored in an appropriate secure storage location. It should never be hard-coded in the repository.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+def exampleFlaskMiddleware(request):
+ g.user = psg.authenticateRequest(request)
+
+@auth.route('/home')
+def authenticatedEndpoint():
+ user = psg.getPassageUser(g.user)
+ print(user.email)
+```
+
+The information available in the Passage User object is as
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| id | string |
+| email | string |
+| phone | string |
+| status | string |
+| email_verified | boolean |
+| phone_verified | boolean |
+| created_at | Datetime |
+| last_login_at | Datetime |
+| webauthn | boolean |
+| webauthn_devices | array |
+| recent_events | array of PassageEvents |
+
+## Activate/Deactivate User
+
+You can also activate or deactivate a user using the Passage SDK. These actions require an API Key and deactivating a user will prevent them from logging into your application
+with Passage.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+#activate or deactivate this user
+psg.deactivateUser(user_id)
+```
+
+## Update User Attributes
+
+You can also update a user's attributes using the Passage SDK. This will require a Passage API Key.
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# update a user (note that user_metadata is optional)
+psg.updateUser(user_id, {
+ "email": "newEmail@domain.com",
+ "phone": "+15005550006",
+ "user_metadata": {
+ "example1": "example metadata"
+ }
+})
+```
+
+## Create User
+
+You can also create users using their email address or phone number. Note that their phone number must be in E164 format (example shown below).
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# create a user via their email (note that user_metadata is optional)
+psg.createUser({
+ "email": "exampleEmail@domain.com",
+ "user_metadata": {
+ "example1": "example metadata"
+ }
+})
+
+# create a user via their phone number
+psg.createUser({"phone": "+15005550007"})
+```
+
+## Delete User
+
+```python
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# Get Passage User ID from database
+# ...
+
+# delete a user via their userID
+deleted_user = psg.deleteUser(user_id)
+if deleted_user:
+ print("User has been deleted")
+```
+
+## Create an Embeddable Magic Link
+
+To create a magic link, you should use the `createMagicLink` method. The method takes in `MagicLinkAttributes`, which is in this structure:
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| user_id | string |
+| email | string |
+| phone | string |
+| channel | ChannelType |
+| send | boolean |
+| magic_link_path | string |
+| redirect_url | string |
+
+The information it returns is in a PassageMagicLink object with this structure:
+
+| Field | Type |
+| ---------------- | ---------------------- |
+| id | string |
+| secret | string |
+| activated | boolean |
+| user_id | string |
+| app_id | string |
+| identifier | string |
+| type | Datetime |
+| webauthn | boolean |
+| webauthn_devices | array |
+| recent_events | array of PassageEvents |
+
+```python
+
+from passageidentity import Passage
+import os
+
+PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
+PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")
+psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)
+
+# create a magic link
+magicLink = psg.createMagicLink(magicLinkAttributes={"email": "<example@email.com>", "channel": "email"})
+```
+
+
+%prep
+%autosetup -n passage-identity-2.1.2
+
+%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-passage-identity -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 2.1.2-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..17edc2e
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8b45a2671efb4c69fce481391cda95a0 passage-identity-2.1.2.tar.gz