summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2015-11-14 11:16:04 +0000
committerSteve Holme <steve_holme@hotmail.com>2015-11-14 11:16:04 +0000
commitba4d8f7eba8e548af80ae72fa42ab82fad4fa009 (patch)
tree952587e72b80219df920a922b2f1f172b9415724 /tests
parentfebda2f3058b6a29562183b6fd514f8acd9d4e75 (diff)
downloadcurl-ba4d8f7eba8e548af80ae72fa42ab82fad4fa009.tar.gz
tests: Added OAuth 2.0 (OAUTHBEARER) tests
Diffstat (limited to 'tests')
-rw-r--r--tests/data/Makefile.inc6
-rw-r--r--tests/data/test84257
-rw-r--r--tests/data/test84357
-rw-r--r--tests/data/test88758
-rw-r--r--tests/data/test88857
-rw-r--r--tests/data/test94657
-rw-r--r--tests/data/test94756
7 files changed, 345 insertions, 3 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index bc47b9035..b6ef6c13a 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -86,20 +86,20 @@ 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 \
+test836 test837 test838 test839 test840 test841 test842 test843 \
\
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 \
+test886 test887 test888 \
\
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 \
+test945 test946 test947 \
\
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
diff --git a/tests/data/test842 b/tests/data/test842
new file mode 100644
index 000000000..423335755
--- /dev/null
+++ b/tests/data/test842
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+IMAP
+SASL
+SASL AUTH OAUTH2
+RFC6749
+RFC7628
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+AUTH OAUTHBEARER
+REPLY AUTHENTICATE +
+REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== A002 OK AUTHENTICATE completed
+</servercmd>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+imap
+</server>
+ <name>
+IMAP OAuth 2.0 (OAUTHBEARER) authentication
+ </name>
+ <command>
+'imap://%HOSTIP:%IMAPPORT/842/;UID=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+A001 CAPABILITY
+A002 AUTHENTICATE OAUTHBEARER
+dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+A003 SELECT 842
+A004 FETCH 1 BODY[]
+A005 LOGOUT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test843 b/tests/data/test843
new file mode 100644
index 000000000..afaa83645
--- /dev/null
+++ b/tests/data/test843
@@ -0,0 +1,57 @@
+<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 A002 OK AUTHENTICATE completed
+</servercmd>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+imap
+</server>
+ <name>
+IMAP OAuth 2.0 (OAUTH2BEARER) authentication with initial response
+ </name>
+ <command>
+'imap://%HOSTIP:%IMAPPORT/843/;UID=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+A001 CAPABILITY
+A002 AUTHENTICATE OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+A003 SELECT 843
+A004 FETCH 1 BODY[]
+A005 LOGOUT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test887 b/tests/data/test887
new file mode 100644
index 000000000..92a0e88f0
--- /dev/null
+++ b/tests/data/test887
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+POP3
+SASL
+SASL AUTH OAUTH2
+RFC1734
+RFC5034
+RFC6749
+RFC7628
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+AUTH OAUTHBEARER
+REPLY AUTH +
+REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== +OK Login successful
+</servercmd>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+pop3
+</server>
+ <name>
+POP3 OAuth 2.0 (OAUTHBEARER) authentication
+ </name>
+ <command>
+pop3://%HOSTIP:%POP3PORT/887 -u user --oauth2-bearer mF_9.B5f-4.1JqM
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+CAPA
+AUTH OAUTHBEARER
+dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+RETR 887
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test888 b/tests/data/test888
new file mode 100644
index 000000000..63a9b6ede
--- /dev/null
+++ b/tests/data/test888
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+POP3
+SASL
+SASL AUTH OAUTH2
+SASL-IR
+RFC1734
+RFC5034
+RFC6749
+RFC7628
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+AUTH OAUTHBEARER
+REPLY AUTH +OK Login successful
+</servercmd>
+<data>
+From: me@somewhere
+To: fake@nowhere
+
+body
+
+--
+ yours sincerely
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+pop3
+</server>
+ <name>
+POP3 OAuth 2.0 (OAUTHBEARER) authentication with initial response
+ </name>
+ <command>
+pop3://%HOSTIP:%POP3PORT/888 -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+CAPA
+AUTH OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+RETR 888
+QUIT
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test946 b/tests/data/test946
new file mode 100644
index 000000000..e2677bd5e
--- /dev/null
+++ b/tests/data/test946
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SASL
+SASL AUTH OAUTH2
+RFC4954
+RFC6749
+RFC7628
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+AUTH OAUTHBEARER
+REPLY AUTH 334 OAUTH2BEARER supported
+REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 235 Authenticated
+</servercmd>
+</reply>
+
+#vi
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP OAuth 2.0 (OAUTHBEARER) authentication
+ </name>
+<stdin>
+mail body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/946 --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>
+<protocol>
+EHLO 946
+AUTH OAUTHBEARER
+dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+MAIL FROM:<sender@example.com>
+RCPT TO:<recipient@example.com>
+DATA
+QUIT
+</protocol>
+<upload>
+mail body
+.
+</upload>
+</verify>
+</testcase>
diff --git a/tests/data/test947 b/tests/data/test947
new file mode 100644
index 000000000..ad7cd78cb
--- /dev/null
+++ b/tests/data/test947
@@ -0,0 +1,56 @@
+<testcase>
+<info>
+<keywords>
+SMTP
+SASL
+SASL AUTH OAUTH2
+SASL-IR
+RFC4954
+RFC6749
+RFC7628
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<servercmd>
+AUTH OAUTHBEARER
+REPLY AUTH 235 Authenticated
+</servercmd>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+smtp
+</server>
+ <name>
+SMTP OAuth 2.0 authentication (OAUTHBEARER) with initial response
+ </name>
+<stdin>
+mail body
+</stdin>
+ <command>
+smtp://%HOSTIP:%SMTPPORT/947 --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>
+<protocol>
+EHLO 947
+AUTH OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+MAIL FROM:<sender@example.com>
+RCPT TO:<recipient@example.com>
+DATA
+QUIT
+</protocol>
+<upload>
+mail body
+.
+</upload>
+</verify>
+</testcase>