Skip to content

Commit 2adcb39

Browse files
kaoudiscmeister2
authored andcommitted
corpus: Add enum for HTTP auth strings
Taken from curl/curl.h and converted to Python, for convenience when writing corpus seed cases.
1 parent a08c660 commit 2adcb39

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

corpus_curl_opt_http_auth.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python
2+
# Allow using strings to represent CURLOPT_HTTPAUTH values when
3+
# generating corpus files. The original defines live in curl.h.
4+
5+
from enum import Enum
6+
7+
class CurlOptHttpAuth(Enum):
8+
#define CURLAUTH_NONE ((unsigned long)0)
9+
CURLAUTH_NONE = 0
10+
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
11+
CURLAUTH_BASIC = 1
12+
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
13+
CURLAUTH_DIGEST = 2
14+
#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
15+
CURLAUTH_NEGOTIATE = 4
16+
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
17+
CURLAUTH_NTLM = 8
18+
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
19+
CURLAUTH_DIGEST_IE = 16
20+
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
21+
CURLAUTH_NTLM_WB = 32
22+
#define CURLAUTH_BEARER (((unsigned long)1)<<6)
23+
CURLAUTH_BEARER = 64
24+
#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
25+
CURLAUTH_AWS_SIGV4 = 128
26+
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
27+
CURLAUTH_ONLY = 2147483648
28+
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
29+
CURLAUTH_ANY = 4294967279
30+
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
31+
CURLAUTH_ANYSAFE = 4294967278

0 commit comments

Comments
 (0)