summaryrefslogtreecommitdiff
path: root/python-krbticket.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-29 12:01:43 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-29 12:01:43 +0000
commit87984b1e8d42ea76d9116fa9c14e497bb5536beb (patch)
tree2cc7734c7d4070109c2fcc12983d043c4c6992e3 /python-krbticket.spec
parent4ba32412b6fcc7f1bb34d42754856a1784ee7ede (diff)
automatic import of python-krbticket
Diffstat (limited to 'python-krbticket.spec')
-rw-r--r--python-krbticket.spec280
1 files changed, 280 insertions, 0 deletions
diff --git a/python-krbticket.spec b/python-krbticket.spec
new file mode 100644
index 0000000..90b3471
--- /dev/null
+++ b/python-krbticket.spec
@@ -0,0 +1,280 @@
+%global _empty_manifest_terminate_build 0
+Name: python-krbticket
+Version: 1.0.6
+Release: 1
+Summary: Kerberos Ticket Manager
+License: MIT License
+URL: https://github.com/ksauzz/krbticket
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b2/de/d00159986d398da6da07253a392f324e880e758b21bf1478e0e6c6371cf2/krbticket-1.0.6.tar.gz
+BuildArch: noarch
+
+Requires: python3-retrying
+Requires: python3-fasteners
+Requires: python3-pytest
+Requires: python3-pytest-cov
+Requires: python3-pytest-mock
+Requires: python3-flake8
+Requires: python3-freezegun
+
+%description
+# Kerberos Ticket Manager
+
+![build status](https://github.com/ksauzz/krbticket/workflows/test/badge.svg)
+
+Simple kinit wrapper to update Kerberos ticket periodically for long running application.
+
+## Getting Started
+
+Periodical kerberos ticket update
+
+```
+from krbticket import KrbTicket
+
+ticket = KrbTicket.init("<principal>", "<keytab path>")
+ticket.updater_start()
+```
+
+If `keytab path` is not specifyed, kinit uses `KRB5_KTNAME` env, or `/etc/krb5.keytab` to find a keytab file. see: kerberos(1) and kinit(1).
+
+### Ticket Updater Strategies
+
+To avoid a credential cache (ccache) corruption by concurrent updates from multiple processes, KrbTicketUpdater has a few update strategies:
+
+- SimpleKrbTicketUpdater: for single updater process, or multiple updaters w/ per process ccache. (default)
+- MultiProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock
+- SingleProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock to restrict the number of updater processes to one against the ccache
+
+```
+from krbticket import KrbTicket, SingleProcessKrbTicketUpdater
+
+ticket = KrbTicket.init("<principal>", "<keytab path>", updater_class=SingleProcessKrbTicketUpdater)
+ticket.updater_start()
+```
+
+### Retry
+
+krbticket supports retry feature utilizing [retrying](https://github.com/rholder/retrying) which provides various retry strategy. To change the behavior, pass the options using `retry_options` of KrbConfig. The dafault values are:
+
+- wait_exponential_multiplier = 1000
+- wait_exponential_max = 30000
+- stop_max_attempt_number = 10
+
+```
+from krbticket import KrbTicket
+
+retry_options = {
+ 'wait_exponential_multiplier': 1000,
+ 'wait_exponential_max': 10000,
+ 'stop_max_attempt_number': 5
+}
+ticket = KrbTicket.init("<principal>", "<keytab path>", retry_options=retry_options)
+ticket.updater_start()
+```
+
+### Update Interval
+
+TBD
+
+## Test
+
+```
+docker run --rm -p 88:88 ksauzz/docker-krb5:0.0.1
+pip install -r requirements-test.txt -r requirements.txt
+KRB5_CONFIG=tests/conf/krb5.conf.local pytest
+```
+
+
+
+
+%package -n python3-krbticket
+Summary: Kerberos Ticket Manager
+Provides: python-krbticket
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-krbticket
+# Kerberos Ticket Manager
+
+![build status](https://github.com/ksauzz/krbticket/workflows/test/badge.svg)
+
+Simple kinit wrapper to update Kerberos ticket periodically for long running application.
+
+## Getting Started
+
+Periodical kerberos ticket update
+
+```
+from krbticket import KrbTicket
+
+ticket = KrbTicket.init("<principal>", "<keytab path>")
+ticket.updater_start()
+```
+
+If `keytab path` is not specifyed, kinit uses `KRB5_KTNAME` env, or `/etc/krb5.keytab` to find a keytab file. see: kerberos(1) and kinit(1).
+
+### Ticket Updater Strategies
+
+To avoid a credential cache (ccache) corruption by concurrent updates from multiple processes, KrbTicketUpdater has a few update strategies:
+
+- SimpleKrbTicketUpdater: for single updater process, or multiple updaters w/ per process ccache. (default)
+- MultiProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock
+- SingleProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock to restrict the number of updater processes to one against the ccache
+
+```
+from krbticket import KrbTicket, SingleProcessKrbTicketUpdater
+
+ticket = KrbTicket.init("<principal>", "<keytab path>", updater_class=SingleProcessKrbTicketUpdater)
+ticket.updater_start()
+```
+
+### Retry
+
+krbticket supports retry feature utilizing [retrying](https://github.com/rholder/retrying) which provides various retry strategy. To change the behavior, pass the options using `retry_options` of KrbConfig. The dafault values are:
+
+- wait_exponential_multiplier = 1000
+- wait_exponential_max = 30000
+- stop_max_attempt_number = 10
+
+```
+from krbticket import KrbTicket
+
+retry_options = {
+ 'wait_exponential_multiplier': 1000,
+ 'wait_exponential_max': 10000,
+ 'stop_max_attempt_number': 5
+}
+ticket = KrbTicket.init("<principal>", "<keytab path>", retry_options=retry_options)
+ticket.updater_start()
+```
+
+### Update Interval
+
+TBD
+
+## Test
+
+```
+docker run --rm -p 88:88 ksauzz/docker-krb5:0.0.1
+pip install -r requirements-test.txt -r requirements.txt
+KRB5_CONFIG=tests/conf/krb5.conf.local pytest
+```
+
+
+
+
+%package help
+Summary: Development documents and examples for krbticket
+Provides: python3-krbticket-doc
+%description help
+# Kerberos Ticket Manager
+
+![build status](https://github.com/ksauzz/krbticket/workflows/test/badge.svg)
+
+Simple kinit wrapper to update Kerberos ticket periodically for long running application.
+
+## Getting Started
+
+Periodical kerberos ticket update
+
+```
+from krbticket import KrbTicket
+
+ticket = KrbTicket.init("<principal>", "<keytab path>")
+ticket.updater_start()
+```
+
+If `keytab path` is not specifyed, kinit uses `KRB5_KTNAME` env, or `/etc/krb5.keytab` to find a keytab file. see: kerberos(1) and kinit(1).
+
+### Ticket Updater Strategies
+
+To avoid a credential cache (ccache) corruption by concurrent updates from multiple processes, KrbTicketUpdater has a few update strategies:
+
+- SimpleKrbTicketUpdater: for single updater process, or multiple updaters w/ per process ccache. (default)
+- MultiProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock
+- SingleProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock to restrict the number of updater processes to one against the ccache
+
+```
+from krbticket import KrbTicket, SingleProcessKrbTicketUpdater
+
+ticket = KrbTicket.init("<principal>", "<keytab path>", updater_class=SingleProcessKrbTicketUpdater)
+ticket.updater_start()
+```
+
+### Retry
+
+krbticket supports retry feature utilizing [retrying](https://github.com/rholder/retrying) which provides various retry strategy. To change the behavior, pass the options using `retry_options` of KrbConfig. The dafault values are:
+
+- wait_exponential_multiplier = 1000
+- wait_exponential_max = 30000
+- stop_max_attempt_number = 10
+
+```
+from krbticket import KrbTicket
+
+retry_options = {
+ 'wait_exponential_multiplier': 1000,
+ 'wait_exponential_max': 10000,
+ 'stop_max_attempt_number': 5
+}
+ticket = KrbTicket.init("<principal>", "<keytab path>", retry_options=retry_options)
+ticket.updater_start()
+```
+
+### Update Interval
+
+TBD
+
+## Test
+
+```
+docker run --rm -p 88:88 ksauzz/docker-krb5:0.0.1
+pip install -r requirements-test.txt -r requirements.txt
+KRB5_CONFIG=tests/conf/krb5.conf.local pytest
+```
+
+
+
+
+%prep
+%autosetup -n krbticket-1.0.6
+
+%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-krbticket -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.6-1
+- Package Spec generated