diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 13:43:38 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 13:43:38 +0000 |
| commit | 267d578bb2454912c83b7824ac1f5f2c09c56fda (patch) | |
| tree | 95076dcf429e5b1c7fdf9d1f45ba6323ea7ec004 /python-fortifyapi.spec | |
| parent | 5ac870b006930ae6b1e7a400e5f144b50e117d5d (diff) | |
automatic import of python-fortifyapiopeneuler20.03
Diffstat (limited to 'python-fortifyapi.spec')
| -rw-r--r-- | python-fortifyapi.spec | 283 |
1 files changed, 283 insertions, 0 deletions
diff --git a/python-fortifyapi.spec b/python-fortifyapi.spec new file mode 100644 index 0000000..85c757e --- /dev/null +++ b/python-fortifyapi.spec @@ -0,0 +1,283 @@ +%global _empty_manifest_terminate_build 0 +Name: python-fortifyapi +Version: 3.1.4 +Release: 1 +Summary: Python library for Fortify Software Security Center (SSC) RESTFul API +License: MIT +URL: https://github.com/fortifyadmin/fortifyapi +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/35/3d/0f18fc995d99e8efec7dfa1aaefcfc5a42919cc2aad60576d4fe93cbf1b2/fortifyapi-3.1.4.tar.gz +BuildArch: noarch + +Requires: python3-requests + +%description +.. image:: https://img.shields.io/pypi/v/fortifyapi.svg +.. image:: https://img.shields.io/pypi/pyversions/fortifyapi.svg +.. image:: https://img.shields.io/circleci/build/github/fortifyadmin/fortifyapi/master?logo=CircleCI + +Fortify API +*********** + +Fortify API is a Python RESTFul API client module for Fortify's `Software Security Center <https://www.microfocus.com/en-us/products/software-security-assurance-sdlc/overview/>`_ + +Quick Start +~~~~~~~~~~~ + +Several quick start options are available: + +- Build locally: ``pip install wheel setuptools && python setup.py build`` +- Install with pip (recommended): ``pip install fortifyapi`` +- `Download the latest release <https://pypi.org/project/fortifyapi/>`__. + +Example +~~~~~~~ + +.. code:: python + + from os import environ + from locale import LC_ALL, setlocale + from fortifyapi.fortify import FortifyApi + + # Set encoding + environ["PYTHONIOENCODING"] = "utf-8" + myLocale = setlocale(category=LC_ALL, locale="en_GB.UTF-8") + + # Set vars for connection + url = 'https://some-fortify-host/ssc' + user = 'Fortify SSC User' + password = 'Fortify SSC Password' + description = 'fortifyapi test client' + + # Authenticate and retrieve token + def token(): + api = FortifyApi(host=url, username=user, password=password, verify_ssl=False) + response = api.get_token(description=description) + return response.data['data']['token'] + + # Re-use token in all requests + def api(): + api = FortifyApi(host=url, token=token(), verify_ssl=False) + return api + + # List ID, Project/application Version + def list(): + response = api().get_all_project_versions() + data = response.data['data'] + for version in data: + print("{0:8} {1:30} {2:30}".format(version['id'], version['project']['name'], version['name']).encode( + 'utf-8', errors='ignore').decode()) + + if __name__ == '__main__': + list() + +Bugs and Feature Requests +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Found something that doesn't seem right or have a feature request? Please open a new issue. + +Copyright and License +~~~~~~~~~~~~~~~~~~~~~ +.. image:: https://img.shields.io/github/license/fortifyadmin/fortifyapi.svg?style=flat-square + + + + + +%package -n python3-fortifyapi +Summary: Python library for Fortify Software Security Center (SSC) RESTFul API +Provides: python-fortifyapi +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-fortifyapi +.. image:: https://img.shields.io/pypi/v/fortifyapi.svg +.. image:: https://img.shields.io/pypi/pyversions/fortifyapi.svg +.. image:: https://img.shields.io/circleci/build/github/fortifyadmin/fortifyapi/master?logo=CircleCI + +Fortify API +*********** + +Fortify API is a Python RESTFul API client module for Fortify's `Software Security Center <https://www.microfocus.com/en-us/products/software-security-assurance-sdlc/overview/>`_ + +Quick Start +~~~~~~~~~~~ + +Several quick start options are available: + +- Build locally: ``pip install wheel setuptools && python setup.py build`` +- Install with pip (recommended): ``pip install fortifyapi`` +- `Download the latest release <https://pypi.org/project/fortifyapi/>`__. + +Example +~~~~~~~ + +.. code:: python + + from os import environ + from locale import LC_ALL, setlocale + from fortifyapi.fortify import FortifyApi + + # Set encoding + environ["PYTHONIOENCODING"] = "utf-8" + myLocale = setlocale(category=LC_ALL, locale="en_GB.UTF-8") + + # Set vars for connection + url = 'https://some-fortify-host/ssc' + user = 'Fortify SSC User' + password = 'Fortify SSC Password' + description = 'fortifyapi test client' + + # Authenticate and retrieve token + def token(): + api = FortifyApi(host=url, username=user, password=password, verify_ssl=False) + response = api.get_token(description=description) + return response.data['data']['token'] + + # Re-use token in all requests + def api(): + api = FortifyApi(host=url, token=token(), verify_ssl=False) + return api + + # List ID, Project/application Version + def list(): + response = api().get_all_project_versions() + data = response.data['data'] + for version in data: + print("{0:8} {1:30} {2:30}".format(version['id'], version['project']['name'], version['name']).encode( + 'utf-8', errors='ignore').decode()) + + if __name__ == '__main__': + list() + +Bugs and Feature Requests +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Found something that doesn't seem right or have a feature request? Please open a new issue. + +Copyright and License +~~~~~~~~~~~~~~~~~~~~~ +.. image:: https://img.shields.io/github/license/fortifyadmin/fortifyapi.svg?style=flat-square + + + + + +%package help +Summary: Development documents and examples for fortifyapi +Provides: python3-fortifyapi-doc +%description help +.. image:: https://img.shields.io/pypi/v/fortifyapi.svg +.. image:: https://img.shields.io/pypi/pyversions/fortifyapi.svg +.. image:: https://img.shields.io/circleci/build/github/fortifyadmin/fortifyapi/master?logo=CircleCI + +Fortify API +*********** + +Fortify API is a Python RESTFul API client module for Fortify's `Software Security Center <https://www.microfocus.com/en-us/products/software-security-assurance-sdlc/overview/>`_ + +Quick Start +~~~~~~~~~~~ + +Several quick start options are available: + +- Build locally: ``pip install wheel setuptools && python setup.py build`` +- Install with pip (recommended): ``pip install fortifyapi`` +- `Download the latest release <https://pypi.org/project/fortifyapi/>`__. + +Example +~~~~~~~ + +.. code:: python + + from os import environ + from locale import LC_ALL, setlocale + from fortifyapi.fortify import FortifyApi + + # Set encoding + environ["PYTHONIOENCODING"] = "utf-8" + myLocale = setlocale(category=LC_ALL, locale="en_GB.UTF-8") + + # Set vars for connection + url = 'https://some-fortify-host/ssc' + user = 'Fortify SSC User' + password = 'Fortify SSC Password' + description = 'fortifyapi test client' + + # Authenticate and retrieve token + def token(): + api = FortifyApi(host=url, username=user, password=password, verify_ssl=False) + response = api.get_token(description=description) + return response.data['data']['token'] + + # Re-use token in all requests + def api(): + api = FortifyApi(host=url, token=token(), verify_ssl=False) + return api + + # List ID, Project/application Version + def list(): + response = api().get_all_project_versions() + data = response.data['data'] + for version in data: + print("{0:8} {1:30} {2:30}".format(version['id'], version['project']['name'], version['name']).encode( + 'utf-8', errors='ignore').decode()) + + if __name__ == '__main__': + list() + +Bugs and Feature Requests +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Found something that doesn't seem right or have a feature request? Please open a new issue. + +Copyright and License +~~~~~~~~~~~~~~~~~~~~~ +.. image:: https://img.shields.io/github/license/fortifyadmin/fortifyapi.svg?style=flat-square + + + + + +%prep +%autosetup -n fortifyapi-3.1.4 + +%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-fortifyapi -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 3.1.4-1 +- Package Spec generated |
