summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-10 19:45:39 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-10 19:45:39 +0000
commitb874d99167487f1153943f6109386ba4b8a18b90 (patch)
tree53ba5ebc398f6e55961864a17ff725ec3808f432
parentf03f3f7b30034744b9a134d33268716d74497f53 (diff)
automatic import of python-requests-ntlm2
-rw-r--r--.gitignore1
-rw-r--r--python-requests-ntlm2.spec484
-rw-r--r--sources1
3 files changed, 486 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..e3e72ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/requests_ntlm2-6.5.2.tar.gz
diff --git a/python-requests-ntlm2.spec b/python-requests-ntlm2.spec
new file mode 100644
index 0000000..406d995
--- /dev/null
+++ b/python-requests-ntlm2.spec
@@ -0,0 +1,484 @@
+%global _empty_manifest_terminate_build 0
+Name: python-requests-ntlm2
+Version: 6.5.2
+Release: 1
+Summary: The HTTP NTLM proxy and/or server authentication library.
+License: ISC
+URL: https://github.com/dopstar/requests-ntlm2
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e3/07/2c323a4ae556966c94440413125718ac188d287cfb15d9d46c1ca7ad78fb/requests_ntlm2-6.5.2.tar.gz
+BuildArch: noarch
+
+Requires: python3-requests
+Requires: python3-ntlm-auth
+Requires: python3-cryptography
+Requires: python3-six
+Requires: python3-flake8
+Requires: python3-flake8-quotes
+Requires: python3-bandit
+Requires: python3-flake8-isort
+Requires: python3-bandit
+Requires: python3-flake8-isort
+Requires: python3-flask
+Requires: python3-pytest
+Requires: python3-pytest-cov
+Requires: python3-wheel
+Requires: python3-codecov
+Requires: python3-coverage
+Requires: python3-mock
+Requires: python3-faker
+Requires: python3-trustme
+
+%description
+<h1 align="center">requests-ntlm2</h1>
+<div align="center">NTLM authentication plugin for Requests</div>
+<br />
+
+[![Build Status](https://github.com/dopstar/requests-ntlm2/workflows/build/badge.svg?branch=master)](https://github.com/dopstar/requests-ntlm2/actions?query=workflow%3Abuild)
+[![codecov](https://codecov.io/gh/dopstar/requests-ntlm2/branch/master/graph/badge.svg)](https://codecov.io/gh/dopstar/requests-ntlm2)
+[![Python Version](https://img.shields.io/pypi/pyversions/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![PyPI Status](https://img.shields.io/pypi/v/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![Downloads](https://img.shields.io/pypi/dm/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![Licence](https://img.shields.io/github/license/dopstar/requests-ntlm2.svg)](https://raw.githubusercontent.com/dopstar/requests-ntlm2/master/LICENSE)
+[![Code Style: Black](https://img.shields.io/badge/code%20style-black-101010.svg)](https://github.com/psf/black)
+
+requests-ntlm2, which is based on [requests-ntlm](https://github.com/requests/requests-ntlm), allows for HTTP NTLM authentication using the requests library.
+
+## Installation
+
+```shell
+pip install requests-ntlm2
+```
+
+## Usage
+
+### Basic Usage
+`HttpNtlmAuth` extends requests `AuthBase`, so usage is simple:
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth
+
+auth=HttpNtlmAuth('domain\\username','password')
+requests.get("http://ntlm_protected_site.com", auth=auth)
+```
+___
+
+### Changing NTLM compatibility level
+See this [MS doc](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc960646%28v=technet.10%29) on LM compatibility levels. `requests_ntlm2` defaults to
+compatibility level 3 which supports NTLMv2 [only]. You can change the compatibility level as follows:
+
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth, NtlmCompatibility
+
+username = 'domain\\username'
+password = 'password123'
+ntlm_compatibility = NtlmCompatibility.LM_AND_NTLMv1_WITH_ESS # => level 1
+auth=HttpNtlmAuth(username, password, ntlm_compatibility=ntlm_compatibility)
+
+requests.get("http://ntlm_protected_site.com", auth=auth)
+```
+___
+
+### Using with Requests Session
+`HttpNtlmAuth` can be used in conjunction with a `Session` in order to
+make use of connection pooling. Since NTLM authenticates connections,
+this is more efficient. Otherwise, each request will go through a new
+NTLM challenge-response.
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth
+
+session = requests.Session()
+session.auth = HttpNtlmAuth('domain\\username','password')
+session.get('http://ntlm_protected_site.com')
+```
+___
+
+### HTTP CONNECT Usage
+When using `requests-ntlm2` to create SSL proxy tunnel via
+[HTTP CONNECT](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method), the so-called
+"NTLM Dance" - ie, the NTLM authentication handshake - has to be done at the lower level
+(at `httplib` level) at tunnel-creation step. This means that you should use the `HttpNtlmAdapter`
+and requests session. This `HttpNtlmAdapter` is responsible for sending proxy auth information
+downstream.
+
+Here is a basic example:
+
+```python
+import requests
+from requests_ntlm2 import (
+ HttpNtlmAuth,
+ HttpNtlmAdapter,
+ NtlmCompatibility
+)
+
+username = '...'
+password = '...'
+proxy_ip = '...'
+proxy_port = '...'
+
+proxies = {
+ 'http': 'http://{}:{}'.format(proxy_ip, proxy_port),
+ 'https': 'http://{}:{}'.format(proxy_ip, proxy_port)
+}
+
+ntlm_compatibility = NtlmCompatibility.NTLMv2_DEFAULT
+
+session = requests.Session()
+session.mount(
+ 'https://',
+ HttpNtlmAdapter(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+ )
+)
+session.mount(
+ 'http://',
+ HttpNtlmAdapter(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+ )
+)
+session.auth = HttpNtlmAuth(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+)
+session.proxies = proxies
+
+response = session.get('http:/foobar.com')
+```
+
+## Requirements
+
+- [requests](https://github.com/kennethreitz/requests/)
+- [ntlm-auth](https://github.com/jborean93/ntlm-auth)
+
+
+
+
+%package -n python3-requests-ntlm2
+Summary: The HTTP NTLM proxy and/or server authentication library.
+Provides: python-requests-ntlm2
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-requests-ntlm2
+<h1 align="center">requests-ntlm2</h1>
+<div align="center">NTLM authentication plugin for Requests</div>
+<br />
+
+[![Build Status](https://github.com/dopstar/requests-ntlm2/workflows/build/badge.svg?branch=master)](https://github.com/dopstar/requests-ntlm2/actions?query=workflow%3Abuild)
+[![codecov](https://codecov.io/gh/dopstar/requests-ntlm2/branch/master/graph/badge.svg)](https://codecov.io/gh/dopstar/requests-ntlm2)
+[![Python Version](https://img.shields.io/pypi/pyversions/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![PyPI Status](https://img.shields.io/pypi/v/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![Downloads](https://img.shields.io/pypi/dm/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![Licence](https://img.shields.io/github/license/dopstar/requests-ntlm2.svg)](https://raw.githubusercontent.com/dopstar/requests-ntlm2/master/LICENSE)
+[![Code Style: Black](https://img.shields.io/badge/code%20style-black-101010.svg)](https://github.com/psf/black)
+
+requests-ntlm2, which is based on [requests-ntlm](https://github.com/requests/requests-ntlm), allows for HTTP NTLM authentication using the requests library.
+
+## Installation
+
+```shell
+pip install requests-ntlm2
+```
+
+## Usage
+
+### Basic Usage
+`HttpNtlmAuth` extends requests `AuthBase`, so usage is simple:
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth
+
+auth=HttpNtlmAuth('domain\\username','password')
+requests.get("http://ntlm_protected_site.com", auth=auth)
+```
+___
+
+### Changing NTLM compatibility level
+See this [MS doc](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc960646%28v=technet.10%29) on LM compatibility levels. `requests_ntlm2` defaults to
+compatibility level 3 which supports NTLMv2 [only]. You can change the compatibility level as follows:
+
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth, NtlmCompatibility
+
+username = 'domain\\username'
+password = 'password123'
+ntlm_compatibility = NtlmCompatibility.LM_AND_NTLMv1_WITH_ESS # => level 1
+auth=HttpNtlmAuth(username, password, ntlm_compatibility=ntlm_compatibility)
+
+requests.get("http://ntlm_protected_site.com", auth=auth)
+```
+___
+
+### Using with Requests Session
+`HttpNtlmAuth` can be used in conjunction with a `Session` in order to
+make use of connection pooling. Since NTLM authenticates connections,
+this is more efficient. Otherwise, each request will go through a new
+NTLM challenge-response.
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth
+
+session = requests.Session()
+session.auth = HttpNtlmAuth('domain\\username','password')
+session.get('http://ntlm_protected_site.com')
+```
+___
+
+### HTTP CONNECT Usage
+When using `requests-ntlm2` to create SSL proxy tunnel via
+[HTTP CONNECT](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method), the so-called
+"NTLM Dance" - ie, the NTLM authentication handshake - has to be done at the lower level
+(at `httplib` level) at tunnel-creation step. This means that you should use the `HttpNtlmAdapter`
+and requests session. This `HttpNtlmAdapter` is responsible for sending proxy auth information
+downstream.
+
+Here is a basic example:
+
+```python
+import requests
+from requests_ntlm2 import (
+ HttpNtlmAuth,
+ HttpNtlmAdapter,
+ NtlmCompatibility
+)
+
+username = '...'
+password = '...'
+proxy_ip = '...'
+proxy_port = '...'
+
+proxies = {
+ 'http': 'http://{}:{}'.format(proxy_ip, proxy_port),
+ 'https': 'http://{}:{}'.format(proxy_ip, proxy_port)
+}
+
+ntlm_compatibility = NtlmCompatibility.NTLMv2_DEFAULT
+
+session = requests.Session()
+session.mount(
+ 'https://',
+ HttpNtlmAdapter(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+ )
+)
+session.mount(
+ 'http://',
+ HttpNtlmAdapter(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+ )
+)
+session.auth = HttpNtlmAuth(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+)
+session.proxies = proxies
+
+response = session.get('http:/foobar.com')
+```
+
+## Requirements
+
+- [requests](https://github.com/kennethreitz/requests/)
+- [ntlm-auth](https://github.com/jborean93/ntlm-auth)
+
+
+
+
+%package help
+Summary: Development documents and examples for requests-ntlm2
+Provides: python3-requests-ntlm2-doc
+%description help
+<h1 align="center">requests-ntlm2</h1>
+<div align="center">NTLM authentication plugin for Requests</div>
+<br />
+
+[![Build Status](https://github.com/dopstar/requests-ntlm2/workflows/build/badge.svg?branch=master)](https://github.com/dopstar/requests-ntlm2/actions?query=workflow%3Abuild)
+[![codecov](https://codecov.io/gh/dopstar/requests-ntlm2/branch/master/graph/badge.svg)](https://codecov.io/gh/dopstar/requests-ntlm2)
+[![Python Version](https://img.shields.io/pypi/pyversions/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![PyPI Status](https://img.shields.io/pypi/v/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![Downloads](https://img.shields.io/pypi/dm/requests-ntlm2.svg)](https://pypi.python.org/pypi/requests-ntlm2)
+[![Licence](https://img.shields.io/github/license/dopstar/requests-ntlm2.svg)](https://raw.githubusercontent.com/dopstar/requests-ntlm2/master/LICENSE)
+[![Code Style: Black](https://img.shields.io/badge/code%20style-black-101010.svg)](https://github.com/psf/black)
+
+requests-ntlm2, which is based on [requests-ntlm](https://github.com/requests/requests-ntlm), allows for HTTP NTLM authentication using the requests library.
+
+## Installation
+
+```shell
+pip install requests-ntlm2
+```
+
+## Usage
+
+### Basic Usage
+`HttpNtlmAuth` extends requests `AuthBase`, so usage is simple:
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth
+
+auth=HttpNtlmAuth('domain\\username','password')
+requests.get("http://ntlm_protected_site.com", auth=auth)
+```
+___
+
+### Changing NTLM compatibility level
+See this [MS doc](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc960646%28v=technet.10%29) on LM compatibility levels. `requests_ntlm2` defaults to
+compatibility level 3 which supports NTLMv2 [only]. You can change the compatibility level as follows:
+
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth, NtlmCompatibility
+
+username = 'domain\\username'
+password = 'password123'
+ntlm_compatibility = NtlmCompatibility.LM_AND_NTLMv1_WITH_ESS # => level 1
+auth=HttpNtlmAuth(username, password, ntlm_compatibility=ntlm_compatibility)
+
+requests.get("http://ntlm_protected_site.com", auth=auth)
+```
+___
+
+### Using with Requests Session
+`HttpNtlmAuth` can be used in conjunction with a `Session` in order to
+make use of connection pooling. Since NTLM authenticates connections,
+this is more efficient. Otherwise, each request will go through a new
+NTLM challenge-response.
+
+```python
+import requests
+from requests_ntlm2 import HttpNtlmAuth
+
+session = requests.Session()
+session.auth = HttpNtlmAuth('domain\\username','password')
+session.get('http://ntlm_protected_site.com')
+```
+___
+
+### HTTP CONNECT Usage
+When using `requests-ntlm2` to create SSL proxy tunnel via
+[HTTP CONNECT](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method), the so-called
+"NTLM Dance" - ie, the NTLM authentication handshake - has to be done at the lower level
+(at `httplib` level) at tunnel-creation step. This means that you should use the `HttpNtlmAdapter`
+and requests session. This `HttpNtlmAdapter` is responsible for sending proxy auth information
+downstream.
+
+Here is a basic example:
+
+```python
+import requests
+from requests_ntlm2 import (
+ HttpNtlmAuth,
+ HttpNtlmAdapter,
+ NtlmCompatibility
+)
+
+username = '...'
+password = '...'
+proxy_ip = '...'
+proxy_port = '...'
+
+proxies = {
+ 'http': 'http://{}:{}'.format(proxy_ip, proxy_port),
+ 'https': 'http://{}:{}'.format(proxy_ip, proxy_port)
+}
+
+ntlm_compatibility = NtlmCompatibility.NTLMv2_DEFAULT
+
+session = requests.Session()
+session.mount(
+ 'https://',
+ HttpNtlmAdapter(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+ )
+)
+session.mount(
+ 'http://',
+ HttpNtlmAdapter(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+ )
+)
+session.auth = HttpNtlmAuth(
+ username,
+ password,
+ ntlm_compatibility=ntlm_compatibility
+)
+session.proxies = proxies
+
+response = session.get('http:/foobar.com')
+```
+
+## Requirements
+
+- [requests](https://github.com/kennethreitz/requests/)
+- [ntlm-auth](https://github.com/jborean93/ntlm-auth)
+
+
+
+
+%prep
+%autosetup -n requests-ntlm2-6.5.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-requests-ntlm2 -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 6.5.2-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..487e4f7
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+58e917c396b45ba9f1afc4e367f1a4b7 requests_ntlm2-6.5.2.tar.gz