mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
tests: Added OAUTHBEARER failure response tests
This commit is contained in:
parent
ee04bee82b
commit
ca770d87e2
@ -86,20 +86,21 @@ test800 test801 test802 test803 test804 test805 test806 test807 test808 \
|
||||
test809 test810 test811 test812 test813 test814 test815 test816 test817 \
|
||||
test818 test819 test820 test821 test822 test823 test824 test825 test826 \
|
||||
test827 test828 test829 test830 test831 test832 test833 test834 test835 \
|
||||
test836 test837 test838 test839 test840 test841 test842 test843 \
|
||||
test836 test837 test838 test839 test840 test841 test842 test843 test843 \
|
||||
test844 \
|
||||
\
|
||||
test850 test851 test852 test853 test854 test855 test856 test857 test858 \
|
||||
test859 test860 test861 test862 test863 test864 test865 test866 test867 \
|
||||
test868 test869 test870 test871 test872 test873 test874 test875 test876 \
|
||||
test877 test878 test879 test880 test881 test882 test883 test884 test885 \
|
||||
test886 test887 test888 \
|
||||
test886 test887 test888 test889 test890 \
|
||||
\
|
||||
test900 test901 test902 test903 test904 test905 test906 test907 test908 \
|
||||
test909 test910 test911 test912 test913 test914 test915 test916 test917 \
|
||||
test918 test919 test920 test921 test922 test923 test924 test925 test926 \
|
||||
test927 test928 test929 test930 test931 test932 test933 test934 test935 \
|
||||
test936 test937 test938 test939 test940 test941 test942 test943 test944 \
|
||||
test945 test946 test947 \
|
||||
test945 test946 test947 test948 test949 \
|
||||
\
|
||||
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
|
||||
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
|
||||
|
54
tests/data/test844
Normal file
54
tests/data/test844
Normal file
@ -0,0 +1,54 @@
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
IMAP
|
||||
SASL
|
||||
SASL AUTH OAUTH2
|
||||
RFC6749
|
||||
RFC7628
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
AUTH OAUTHBEARER
|
||||
REPLY AUTHENTICATE +
|
||||
REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== + eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0=
|
||||
REPLY AQ== A002 NO Authentication failed
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
imap
|
||||
</server>
|
||||
<name>
|
||||
IMAP OAuth 2.0 (OAUTHBEARER) failure as continuation
|
||||
</name>
|
||||
<command>
|
||||
'imap://%HOSTIP:%IMAPPORT/844/;UID=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 67 - CURLE_LOGIN_DENIED
|
||||
<errorcode>
|
||||
67
|
||||
</errorcode>
|
||||
#
|
||||
# The multi interface considers a broken "CONNECT" as a prematurely broken
|
||||
# transfer and such a connection will not get a "LOGOUT"
|
||||
<protocol>
|
||||
A001 CAPABILITY
|
||||
A002 AUTHENTICATE OAUTHBEARER
|
||||
dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
||||
AQ==
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
54
tests/data/test845
Normal file
54
tests/data/test845
Normal file
@ -0,0 +1,54 @@
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
IMAP
|
||||
SASL
|
||||
SASL AUTH OAUTH2
|
||||
SASL-IR
|
||||
RFC6749
|
||||
RFC7628
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
AUTH OAUTHBEARER
|
||||
CAPA SASL-IR
|
||||
REPLY AUTHENTICATE + eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0=
|
||||
REPLY AQ== A002 NO Authentication failed
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
imap
|
||||
</server>
|
||||
<name>
|
||||
IMAP OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response
|
||||
</name>
|
||||
<command>
|
||||
'imap://%HOSTIP:%IMAPPORT/845/;UID=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 67 - CURLE_LOGIN_DENIED
|
||||
<errorcode>
|
||||
67
|
||||
</errorcode>
|
||||
#
|
||||
# The multi interface considers a broken "CONNECT" as a prematurely broken
|
||||
# transfer and such a connection will not get a "LOGOUT"
|
||||
<protocol>
|
||||
A001 CAPABILITY
|
||||
A002 AUTHENTICATE OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
||||
AQ==
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
56
tests/data/test889
Normal file
56
tests/data/test889
Normal file
@ -0,0 +1,56 @@
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
POP3
|
||||
SASL
|
||||
SASL AUTH OAUTH2
|
||||
RFC1734
|
||||
RFC5034
|
||||
RFC6749
|
||||
RFC7628
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
AUTH OAUTHBEARER
|
||||
REPLY AUTH +
|
||||
REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== + eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
|
||||
REPLY AQ== -ERR Authentication failed
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
pop3
|
||||
</server>
|
||||
<name>
|
||||
POP3 OAuth 2.0 (OAUTHBEARER) failure as continuation
|
||||
</name>
|
||||
<command>
|
||||
pop3://%HOSTIP:%POP3PORT/889 -u user --oauth2-bearer mF_9.B5f-4.1JqM
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 67 - CURLE_LOGIN_DENIED
|
||||
<errorcode>
|
||||
67
|
||||
</errorcode>
|
||||
#
|
||||
# The multi interface considers a broken "CONNECT" as a prematurely broken
|
||||
# transfer and such a connection will not get a "QUIT"
|
||||
<protocol>
|
||||
CAPA
|
||||
AUTH OAUTHBEARER
|
||||
dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
||||
AQ==
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
55
tests/data/test890
Normal file
55
tests/data/test890
Normal file
@ -0,0 +1,55 @@
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
POP3
|
||||
SASL
|
||||
SASL AUTH OAUTH2
|
||||
SASL-IR
|
||||
RFC1734
|
||||
RFC5034
|
||||
RFC6749
|
||||
RFC7628
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
AUTH OAUTHBEARER
|
||||
REPLY AUTH + eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
|
||||
REPLY AQ== -ERR Authentication failed
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
pop3
|
||||
</server>
|
||||
<name>
|
||||
POP3 OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response
|
||||
</name>
|
||||
<command>
|
||||
pop3://%HOSTIP:%POP3PORT/890 -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 67 - CURLE_LOGIN_DENIED
|
||||
<errorcode>
|
||||
67
|
||||
</errorcode>
|
||||
#
|
||||
# The multi interface considers a broken "CONNECT" as a prematurely broken
|
||||
# transfer and such a connection will not get a "QUIT"
|
||||
<protocol>
|
||||
CAPA
|
||||
AUTH OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
||||
AQ==
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
58
tests/data/test948
Normal file
58
tests/data/test948
Normal file
@ -0,0 +1,58 @@
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
SMTP
|
||||
SASL
|
||||
SASL AUTH OAUTH2
|
||||
RFC4954
|
||||
RFC6749
|
||||
RFC7628
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
AUTH OAUTHBEARER
|
||||
REPLY AUTH 334 OAUTHBEARER supported
|
||||
REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 334 eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
|
||||
REPLY AQ== 535 Username and Password not accepted. Learn more at\r\n535 http://support.example.com/mail/oauth
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#vi
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
smtp
|
||||
</server>
|
||||
<name>
|
||||
SMTP OAuth 2.0 (OAUTHBEARER) failure as continuation
|
||||
</name>
|
||||
<stdin>
|
||||
mail body
|
||||
</stdin>
|
||||
<command>
|
||||
smtp://%HOSTIP:%SMTPPORT/948 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T -
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 67 - CURLE_LOGIN_DENIED
|
||||
<errorcode>
|
||||
67
|
||||
</errorcode>
|
||||
#
|
||||
# The multi interface considers a broken "CONNECT" as a prematurely broken
|
||||
# transfer and such a connection will not get a "QUIT"
|
||||
<protocol>
|
||||
EHLO 948
|
||||
AUTH OAUTHBEARER
|
||||
dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
||||
AQ==
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
57
tests/data/test949
Normal file
57
tests/data/test949
Normal file
@ -0,0 +1,57 @@
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
SMTP
|
||||
SASL
|
||||
SASL AUTH OAUTH2
|
||||
SASL-IR
|
||||
RFC4954
|
||||
RFC6749
|
||||
RFC7628
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
AUTH OAUTHBEARER
|
||||
REPLY AUTH 334 eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
|
||||
REPLY AQ== 535 Username and Password not accepted. Learn more at\r\n535 http://support.example.com/mail/oauth
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
smtp
|
||||
</server>
|
||||
<name>
|
||||
SMTP OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response
|
||||
</name>
|
||||
<stdin>
|
||||
mail body
|
||||
</stdin>
|
||||
<command>
|
||||
smtp://%HOSTIP:%SMTPPORT/949 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T -
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 67 - CURLE_LOGIN_DENIED
|
||||
<errorcode>
|
||||
67
|
||||
</errorcode>
|
||||
#
|
||||
# The multi interface considers a broken "CONNECT" as a prematurely broken
|
||||
# transfer and such a connection will not get a "QUIT"
|
||||
<protocol>
|
||||
EHLO 949
|
||||
AUTH OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
|
||||
AQ==
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
Loading…
Reference in New Issue
Block a user