From 83796dda8bcfa7087b83155250a783fb63fcaf70 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:05:38 +0000 Subject: import libcmis-0.5.1-2.el7 --- diff --git a/.gitignore b/.gitignore index 117db14..9f10918 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libcmis-0.4.1.tar.gz +SOURCES/libcmis-0.5.1.tar.gz diff --git a/.libcmis.metadata b/.libcmis.metadata index 02c6c4c..0efb261 100644 --- a/.libcmis.metadata +++ b/.libcmis.metadata @@ -1 +1 @@ -b85833121c0bec56fba8e7033f90bf073004549a SOURCES/libcmis-0.4.1.tar.gz +94c00715ae8a31bc8e5a6a699e36c22d0020649e SOURCES/libcmis-0.5.1.tar.gz diff --git a/SOURCES/0001-Add-new-Google-Drive-OAuth-2.0-login-procedure.patch b/SOURCES/0001-Add-new-Google-Drive-OAuth-2.0-login-procedure.patch new file mode 100644 index 0000000..810280b --- /dev/null +++ b/SOURCES/0001-Add-new-Google-Drive-OAuth-2.0-login-procedure.patch @@ -0,0 +1,122 @@ +From 32aecffb5517dfc3b3674a8f7db418456bd877ed Mon Sep 17 00:00:00 2001 +From: Giuseppe Castagno +Date: Sat, 30 Apr 2016 14:29:56 +0200 +Subject: [PATCH 1/5] Add new Google Drive OAuth 2.0 login procedure. + +The new Google login sequence uses two html pages: first page for user email +the second page for password. + +The older sequence used only one page for both user email and user password. +--- + src/libcmis/oauth2-providers.cxx | 67 +++++++++++++++++++++++++++++++--------- + 1 file changed, 52 insertions(+), 15 deletions(-) + +diff --git a/src/libcmis/oauth2-providers.cxx b/src/libcmis/oauth2-providers.cxx +index 5e7f3bf..68a6aa5 100644 +--- a/src/libcmis/oauth2-providers.cxx ++++ b/src/libcmis/oauth2-providers.cxx +@@ -37,11 +37,28 @@ using namespace std; + string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUrl, + const string& username, const string& password ) + { ++ /* This member function implements 'Google OAuth 2.0' ++ * ++ * The interaction is carried out by libcmis, with no web browser involved. ++ * ++ * Normal sequence (without 2FA) is: ++ * 1) a get to activate login page ++ * receive first login page, html format ++ * 2) subsequent post to sent email ++ * receive html page for password input ++ * 3) subsequent post to send password ++ * receive html page for application consent ++ * 4) subsequent post to send a consent for the application ++ * receive a single-use authorization code ++ * this code is returned as a string ++ */ ++ + static const string CONTENT_TYPE( "application/x-www-form-urlencoded" ); + // STEP 1: Log in + string res; + try + { ++ // send the first get, receive the html login page + res = session->httpGetRequest( authUrl )->getStream( )->str( ); + } + catch ( const CurlException& e ) +@@ -49,20 +66,39 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr + return string( ); + } + +- string loginPost, loginLink; +- if ( !parseResponse( res.c_str( ), loginPost, loginLink ) ) ++ string loginEmailPost, loginEmailLink; ++ if ( !parseResponse( res.c_str( ), loginEmailPost, loginEmailLink ) ) + return string( ); +- +- loginPost += "Email="; +- loginPost += string( username ); +- loginPost += "&Passwd="; +- loginPost += string( password ); +- +- istringstream loginIs( loginPost ); +- string loginRes; +- try ++ ++ loginEmailPost += "Email="; ++ loginEmailPost += string( username ); ++ ++ istringstream loginEmailIs( loginEmailPost ); ++ string loginEmailRes; ++ try ++ { ++ // send a post with user email, receive the html page for password input ++ loginEmailRes = session->httpPostRequest ( loginEmailLink, loginEmailIs, CONTENT_TYPE ) ++ ->getStream( )->str( ); ++ } ++ catch ( const CurlException& e ) ++ { ++ return string( ); ++ } ++ ++ string loginPasswdPost, loginPasswdLink; ++ if ( !parseResponse( loginEmailRes.c_str( ), loginPasswdPost, loginPasswdLink ) ) ++ return string( ); ++ ++ loginPasswdPost += "Passwd="; ++ loginPasswdPost += string( password ); ++ ++ istringstream loginPasswdIs( loginPasswdPost ); ++ string loginPasswdRes; ++ try + { +- loginRes = session->httpPostRequest ( loginLink, loginIs, CONTENT_TYPE ) ++ // send a post with user password, receive the application consent page ++ loginPasswdRes = session->httpPostRequest ( loginPasswdLink, loginPasswdIs, CONTENT_TYPE ) + ->getStream( )->str( ); + } + catch ( const CurlException& e ) +@@ -71,8 +107,8 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr + } + + // STEP 2: allow libcmis to access google drive +- string approvalPost, approvalLink; +- if ( !parseResponse( loginRes. c_str( ), approvalPost, approvalLink) ) ++ string approvalPost, approvalLink; ++ if ( !parseResponse( loginPasswdRes. c_str( ), approvalPost, approvalLink) ) + return string( ); + approvalPost += "submit_access=true"; + +@@ -80,7 +116,8 @@ string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUr + string approvalRes; + try + { +- approvalRes = session->httpPostRequest ( approvalLink, approvalIs, ++ // send a post with application consent ++ approvalRes = session->httpPostRequest ( approvalLink, approvalIs, + CONTENT_TYPE) ->getStream( )->str( ); + } + catch ( const CurlException& e ) +-- +2.7.4 + diff --git a/SOURCES/0001-Fix-int-bool-confusion-on-big-endian-architectures.patch b/SOURCES/0001-Fix-int-bool-confusion-on-big-endian-architectures.patch deleted file mode 100644 index 8670bb2..0000000 --- a/SOURCES/0001-Fix-int-bool-confusion-on-big-endian-architectures.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 433fad370ddd30c43df281b40ff468a842bc1c70 Mon Sep 17 00:00:00 2001 -From: Adam Conrad -Date: Thu, 6 Feb 2014 09:13:32 +0100 -Subject: [PATCH] Fix int/bool confusion on big-endian architectures. - ---- - qa/libcmis-c/test-document.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/qa/libcmis-c/test-document.cxx b/qa/libcmis-c/test-document.cxx -index ccf2224..eb2c01c 100644 ---- a/qa/libcmis-c/test-document.cxx -+++ b/qa/libcmis-c/test-document.cxx -@@ -43,7 +43,7 @@ - - using namespace std; - --extern int isOutOfMemory; -+extern bool isOutOfMemory; - - namespace - { --- -1.8.5.3 - diff --git a/SOURCES/0001-coverity-return-const-string.patch b/SOURCES/0001-coverity-return-const-string.patch deleted file mode 100644 index 3c76fcb..0000000 --- a/SOURCES/0001-coverity-return-const-string.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 1f48b994ac987c20f8da2e4fa9ec0399877655c7 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Thu, 4 Sep 2014 16:48:00 +0200 -Subject: [PATCH] coverity: return const string& - -Otherwise the use in the C wrapper functions is invalid, as the -functions return char* from a string object that is destroyed in the -function scope. ---- - src/libcmis/oauth2-data.hxx | 12 ++++++------ - src/libcmis/rendition.hxx | 12 ++++++------ - 2 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/src/libcmis/oauth2-data.hxx b/src/libcmis/oauth2-data.hxx -index aa99e2c..000f939 100644 ---- a/src/libcmis/oauth2-data.hxx -+++ b/src/libcmis/oauth2-data.hxx -@@ -62,12 +62,12 @@ namespace libcmis - - bool isComplete(); - -- std::string getAuthUrl() { return m_authUrl; } -- std::string getTokenUrl() { return m_tokenUrl; } -- std::string getClientId() { return m_clientId; } -- std::string getClientSecret() { return m_clientSecret; } -- std::string getScope() { return m_scope; } -- std::string getRedirectUri() { return m_redirectUri; } -+ const std::string& getAuthUrl() { return m_authUrl; } -+ const std::string& getTokenUrl() { return m_tokenUrl; } -+ const std::string& getClientId() { return m_clientId; } -+ const std::string& getClientSecret() { return m_clientSecret; } -+ const std::string& getScope() { return m_scope; } -+ const std::string& getRedirectUri() { return m_redirectUri; } - }; - typedef ::boost::shared_ptr< OAuth2Data > OAuth2DataPtr; - } -diff --git a/src/libcmis/rendition.hxx b/src/libcmis/rendition.hxx -index 820b58d..c58b7ac 100644 ---- a/src/libcmis/rendition.hxx -+++ b/src/libcmis/rendition.hxx -@@ -65,18 +65,18 @@ namespace libcmis - - bool isThumbnail( ) { return m_kind == "cmis:thumbnail"; } - -- std::string getStreamId( ) const { return m_streamId; } -- std::string getMimeType( ) const { return m_mimeType; } -- std::string getKind( ) const { return m_kind; } -- std::string getUrl( ) const { return m_href; } -- std::string getTitle( ) const { return m_title; } -+ const std::string& getStreamId( ) const { return m_streamId; } -+ const std::string& getMimeType( ) const { return m_mimeType; } -+ const std::string& getKind( ) const { return m_kind; } -+ const std::string& getUrl( ) const { return m_href; } -+ const std::string& getTitle( ) const { return m_title; } - - /** Provides the stream length in bytes or a negative value if missing. - */ - long getLength( ) const { return m_length; } - long getWidth( ) const { return m_width; } - long getHeight( ) const { return m_height; } -- std::string getRenditionDocumentId( ) { return m_renditionDocumentId; } -+ const std::string& getRenditionDocumentId( ) { return m_renditionDocumentId; } - - std::string toString( ); - }; --- -1.9.3 - diff --git a/SOURCES/0001-fix-mismatching-exceptions.patch b/SOURCES/0001-fix-mismatching-exceptions.patch deleted file mode 100644 index a1845ba..0000000 --- a/SOURCES/0001-fix-mismatching-exceptions.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 043561716b1c7c23c1576631c5bdca93e6e9ffe5 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Fri, 5 Sep 2014 09:53:50 +0200 -Subject: [PATCH] fix mismatching exceptions - ---- - src/libcmis/base-session.cxx | 56 +++++++++++++++++++++++++++++++++++--------- - 1 file changed, 45 insertions(+), 11 deletions(-) - -diff --git a/src/libcmis/base-session.cxx b/src/libcmis/base-session.cxx -index 7f6a413..80c53e4 100644 ---- a/src/libcmis/base-session.cxx -+++ b/src/libcmis/base-session.cxx -@@ -287,8 +287,15 @@ libcmis::HttpResponsePtr BaseSession::httpGetRequest( string url ) throw ( CurlE - // Need to use the refresh token to get a new one. - if ( getHttpStatus( ) == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) - { -- // Refresh the token -- m_oauth2Handler->refresh( ); -+ try -+ { -+ // Refresh the token -+ m_oauth2Handler->refresh( ); -+ } -+ catch ( const libcmis::Exception& e ) -+ { -+ throw CurlException( e.what() ); -+ } - - // Resend the query - try -@@ -370,8 +377,15 @@ libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, v - if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) - { - -- // Refresh the token -- m_oauth2Handler->refresh( ); -+ try -+ { -+ // Refresh the token -+ m_oauth2Handler->refresh( ); -+ } -+ catch ( const libcmis::Exception& e ) -+ { -+ throw CurlException( e.what() ); -+ } - - // Resend the query - try -@@ -457,8 +471,15 @@ libcmis::HttpResponsePtr BaseSession::httpPostRequest( const string& url, istrea - // Need to use the refresh token to get a new one. - if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) - { -- // Refresh the token -- m_oauth2Handler->refresh( ); -+ try -+ { -+ // Refresh the token -+ m_oauth2Handler->refresh( ); -+ } -+ catch ( const libcmis::Exception& e ) -+ { -+ throw CurlException( e.what() ); -+ } - - // Resend the query - try -@@ -501,9 +522,16 @@ void BaseSession::httpDeleteRequest( string url ) throw ( CurlException ) - // Need to use the refresh token to get a new one. - if ( getHttpStatus( ) == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) - { -- -- // Refresh the token -- m_oauth2Handler->refresh( ); -+ try -+ { -+ // Refresh the token -+ m_oauth2Handler->refresh( ); -+ } -+ catch ( const libcmis::Exception& e ) -+ { -+ throw CurlException( e.what() ); -+ } -+ - // Resend the query - try - { -@@ -722,8 +750,14 @@ void BaseSession::setOAuth2Data( libcmis::OAuth2DataPtr oauth2 ) throw ( libcmis - - // Try to get the authentication code using the given provider. - -- authCode = m_oauth2Handler->oauth2Authenticate( ); -- -+ try -+ { -+ authCode = m_oauth2Handler->oauth2Authenticate( ); -+ } -+ catch ( const CurlException& e ) -+ { -+ throw e.getCmisException( ); -+ } - - // If that didn't work, call the fallback provider from SessionFactory - try --- -1.9.3 - diff --git a/SOURCES/0002-Add-new-mokup-login-pages.patch b/SOURCES/0002-Add-new-mokup-login-pages.patch new file mode 100644 index 0000000..32aab37 --- /dev/null +++ b/SOURCES/0002-Add-new-mokup-login-pages.patch @@ -0,0 +1,70 @@ +From 0490c023cd14cbb3d1ba2bc1b648b216f848a648 Mon Sep 17 00:00:00 2001 +From: Giuseppe Castagno +Date: Tue, 3 May 2016 08:35:57 +0200 +Subject: [PATCH 2/5] Add new mokup login pages + +--- + qa/libcmis/data/gdrive/login.html | 12 ------------ + qa/libcmis/data/gdrive/login1.html | 12 ++++++++++++ + qa/libcmis/data/gdrive/login2.html | 11 +++++++++++ + 3 files changed, 23 insertions(+), 12 deletions(-) + delete mode 100644 qa/libcmis/data/gdrive/login.html + create mode 100644 qa/libcmis/data/gdrive/login1.html + create mode 100644 qa/libcmis/data/gdrive/login2.html + +diff --git a/qa/libcmis/data/gdrive/login.html b/qa/libcmis/data/gdrive/login.html +deleted file mode 100644 +index eae53bf..0000000 +--- a/qa/libcmis/data/gdrive/login.html ++++ /dev/null +@@ -1,12 +0,0 @@ +- +- +- +-
+- +- +- +- +- +-
+- +- +diff --git a/qa/libcmis/data/gdrive/login1.html b/qa/libcmis/data/gdrive/login1.html +new file mode 100644 +index 0000000..eae53bf +--- /dev/null ++++ b/qa/libcmis/data/gdrive/login1.html +@@ -0,0 +1,12 @@ ++ ++ ++ ++
++ ++ ++ ++ ++ ++
++ ++ +diff --git a/qa/libcmis/data/gdrive/login2.html b/qa/libcmis/data/gdrive/login2.html +new file mode 100644 +index 0000000..198f816 +--- /dev/null ++++ b/qa/libcmis/data/gdrive/login2.html +@@ -0,0 +1,11 @@ ++ ++ ++ ++
++ ++ ++ ++ ++
++ ++ +-- +2.7.4 + diff --git a/SOURCES/0003-Fix-test-in-test-factory.patch b/SOURCES/0003-Fix-test-in-test-factory.patch new file mode 100644 index 0000000..509a968 --- /dev/null +++ b/SOURCES/0003-Fix-test-in-test-factory.patch @@ -0,0 +1,113 @@ +From 04297298ad9659c949beb7ccd0f75cfd440a4fb8 Mon Sep 17 00:00:00 2001 +From: Giuseppe Castagno +Date: Tue, 3 May 2016 11:47:43 +0200 +Subject: [PATCH 3/5] Fix test in test-factory + +--- + qa/libcmis/data/gdrive/login1.html | 4 ++-- + qa/libcmis/data/gdrive/login2.html | 2 +- + qa/libcmis/test-factory.cxx | 10 ++++++++-- + qa/mockup/mockup-config.cxx | 3 +++ + qa/mockup/mockup-config.h | 6 +++--- + 5 files changed, 17 insertions(+), 8 deletions(-) + +diff --git a/qa/libcmis/data/gdrive/login1.html b/qa/libcmis/data/gdrive/login1.html +index eae53bf..b6da338 100644 +--- a/qa/libcmis/data/gdrive/login1.html ++++ b/qa/libcmis/data/gdrive/login1.html +@@ -1,12 +1,12 @@ + + + +-
++ ++ + + + + +- +
+ + +diff --git a/qa/libcmis/data/gdrive/login2.html b/qa/libcmis/data/gdrive/login2.html +index 198f816..6425091 100644 +--- a/qa/libcmis/data/gdrive/login2.html ++++ b/qa/libcmis/data/gdrive/login2.html +@@ -1,7 +1,7 @@ + + + +-
++ + + + +diff --git a/qa/libcmis/test-factory.cxx b/qa/libcmis/test-factory.cxx +index c0bcb4c..3779e5a 100644 +--- a/qa/libcmis/test-factory.cxx ++++ b/qa/libcmis/test-factory.cxx +@@ -64,6 +64,7 @@ + + #define GDRIVE_AUTH_URL string ( "https://auth/url" ) + #define GDRIVE_LOGIN_URL string ("https://login/url" ) ++#define GDRIVE_LOGIN_URL2 string ("https://login2/url" ) + #define GDRIVE_APPROVAL_URL string ("https://approval/url" ) + #define GDRIVE_TOKEN_URL string ( "https://token/url" ) + +@@ -101,10 +102,15 @@ namespace + string("&redirect_uri=") + OAUTH_REDIRECT_URI + + string("&response_type=code") + + string("&client_id=") + OAUTH_CLIENT_ID; ++ + curl_mockup_addResponse ( GDRIVE_AUTH_URL.c_str(), loginIdentifier.c_str( ), +- "GET", DATA_DIR "/gdrive/login.html", 200, true); ++ "GET", DATA_DIR "/gdrive/login1.html", 200, true); ++ ++ //authentication email ++ curl_mockup_addResponse( GDRIVE_LOGIN_URL2.c_str( ), "", "POST", ++ DATA_DIR "/gdrive/login2.html", 200, true); + +- //authentication response ++ //authentication password, + curl_mockup_addResponse( GDRIVE_LOGIN_URL.c_str( ), "", "POST", + DATA_DIR "/gdrive/approve.html", 200, true); + +diff --git a/qa/mockup/mockup-config.cxx b/qa/mockup/mockup-config.cxx +index f6b84ad..fb19927 100644 +--- a/qa/mockup/mockup-config.cxx ++++ b/qa/mockup/mockup-config.cxx +@@ -117,6 +117,9 @@ namespace mockup + return !m_username.empty( ) && !m_password.empty( ); + } + ++ /** Find a suitable response ++ * using the request as a search key ++ */ + CURLcode Configuration::writeResponse( CurlHandle* handle ) + { + CURLcode code = CURLE_OK; +diff --git a/qa/mockup/mockup-config.h b/qa/mockup/mockup-config.h +index 6b94706..d0fc3bb 100644 +--- a/qa/mockup/mockup-config.h ++++ b/qa/mockup/mockup-config.h +@@ -41,13 +41,13 @@ void curl_mockup_reset( ); + the base URL of the request without parameters + \param matchParam + a string to find in the parameters part of the URL to match ++ \param method ++ HTTP method to match like PUT, GET, POST or DELETE. An empty ++ string matches any method. + \param response + a string corresponding either to the file path of the request + body to send or directly the content to send. This value has + a different meaning depending on isFilePath parameter. +- \param method +- HTTP method to match like PUT, GET, POST or DELETE. An empty +- string matches any method. + \param status + the HTTP status to return. 0 means HTTP OK (200). + \param isFilePath +-- +2.7.4 + diff --git a/SOURCES/0004-Fix-test-in-test-gdrive.patch b/SOURCES/0004-Fix-test-in-test-gdrive.patch new file mode 100644 index 0000000..899148a --- /dev/null +++ b/SOURCES/0004-Fix-test-in-test-gdrive.patch @@ -0,0 +1,74 @@ +From 73662089059eb2e272a4c5eb245a497af044ccf6 Mon Sep 17 00:00:00 2001 +From: Giuseppe Castagno +Date: Tue, 3 May 2016 15:35:57 +0200 +Subject: [PATCH 4/5] Fix test in test-gdrive + +--- + qa/libcmis/test-gdrive.cxx | 32 ++++++++++++++++++++++++-------- + 1 file changed, 24 insertions(+), 8 deletions(-) + +diff --git a/qa/libcmis/test-gdrive.cxx b/qa/libcmis/test-gdrive.cxx +index 0cd9577..6323099 100644 +--- a/qa/libcmis/test-gdrive.cxx ++++ b/qa/libcmis/test-gdrive.cxx +@@ -51,6 +51,7 @@ static const string CLIENT_SECRET ( "mock-secret" ); + static const string USERNAME( "mock-user" ); + static const string PASSWORD( "mock-password" ); + static const string LOGIN_URL ("https://login/url" ); ++static const string LOGIN_URL2 ("https://login2/url" ); + static const string APPROVAL_URL ("https://approval/url" ); + static const string AUTH_URL ( "https://auth/url" ); + static const string TOKEN_URL ( "https://token/url" ); +@@ -149,10 +150,15 @@ GDriveSession GDriveTest::getTestSession( string username, string password ) + string("&redirect_uri=") + REDIRECT_URI + + string("&response_type=code") + + string("&client_id=") + CLIENT_ID; ++ + curl_mockup_addResponse ( AUTH_URL.c_str(), loginIdentifier.c_str( ), +- "GET", DATA_DIR "/gdrive/login.html", 200, true); ++ "GET", DATA_DIR "/gdrive/login1.html", 200, true); ++ ++ //authentication email ++ curl_mockup_addResponse( LOGIN_URL2.c_str( ), empty.c_str( ), "POST", ++ DATA_DIR "/gdrive/login2.html", 200, true); + +- //authentication response ++ //authentication password, + curl_mockup_addResponse( LOGIN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/approve.html", 200, true); + +@@ -171,15 +177,25 @@ void GDriveTest::sessionAuthenticationTest( ) + GDriveSession session = getTestSession( USERNAME, PASSWORD ); + string empty; + +- // Check authentication request +- string authRequest( curl_mockup_getRequestBody( LOGIN_URL.c_str(), empty.c_str( ), ++ // Check authentication request for email ++ string authRequestEmail( curl_mockup_getRequestBody( LOGIN_URL2.c_str(), empty.c_str( ), ++ "POST" ) ); ++ string expectedAuthRequestEmail = ++ string ( "Page=PasswordSeparationSignIn&continue=redirectLink&scope=Scope&service=lso&GALX=cookie" ++ "&Email=") + USERNAME; ++ ++ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Email", ++ expectedAuthRequestEmail, authRequestEmail ); ++ ++ // Check authentication request for password ++ string authRequestPassword( curl_mockup_getRequestBody( LOGIN_URL.c_str(), empty.c_str( ), + "POST" ) ); +- string expectedAuthRequest = ++ string expectedAuthRequestPassword = + string ( "continue=redirectLink&scope=Scope&service=lso&GALX=cookie" +- "&Email=") + USERNAME + string("&Passwd=") + PASSWORD; ++ "&Passwd=") + PASSWORD; + +- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request", +- expectedAuthRequest, authRequest ); ++ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Password", ++ expectedAuthRequestPassword, authRequestPassword ); + + // Check code request + string codeRequest( curl_mockup_getRequestBody( APPROVAL_URL.c_str(), +-- +2.7.4 + diff --git a/SOURCES/0005-Fix-test-in-test-onedrive.patch b/SOURCES/0005-Fix-test-in-test-onedrive.patch new file mode 100644 index 0000000..c2dc0f0 --- /dev/null +++ b/SOURCES/0005-Fix-test-in-test-onedrive.patch @@ -0,0 +1,42 @@ +From 3ebc3d9fe6a9806de2bcdf79ac6398f0c14c3246 Mon Sep 17 00:00:00 2001 +From: Giuseppe Castagno +Date: Tue, 3 May 2016 15:41:52 +0200 +Subject: [PATCH 5/5] Fix test in test-onedrive + +--- + qa/libcmis/test-onedrive.cxx | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/qa/libcmis/test-onedrive.cxx b/qa/libcmis/test-onedrive.cxx +index b88751b..5da8918 100644 +--- a/qa/libcmis/test-onedrive.cxx ++++ b/qa/libcmis/test-onedrive.cxx +@@ -51,6 +51,7 @@ static const string CLIENT_SECRET ( "mock-secret" ); + static const string USERNAME( "mock-user" ); + static const string PASSWORD( "mock-password" ); + static const string LOGIN_URL ("https://login/url" ); ++static const string LOGIN_URL2 ("https://login2/url" ); + static const string APPROVAL_URL ("https://approval/url" ); + static const string AUTH_URL ( "https://auth/url" ); + static const string TOKEN_URL ( "https://token/url" ); +@@ -123,10 +124,15 @@ OneDriveSession OneDriveTest::getTestSession( string username, string password ) + string("&redirect_uri=") + REDIRECT_URI + + string("&response_type=code") + + string("&client_id=") + CLIENT_ID; ++ + curl_mockup_addResponse ( AUTH_URL.c_str(), loginIdentifier.c_str( ), +- "GET", DATA_DIR "/gdrive/login.html", 200, true); ++ "GET", DATA_DIR "/gdrive/login1.html", 200, true); ++ ++ //authentication email ++ curl_mockup_addResponse( LOGIN_URL2.c_str( ), empty.c_str( ), "POST", ++ DATA_DIR "/gdrive/login2.html", 200, true); + +- //authentication response ++ //authentication password + curl_mockup_addResponse( LOGIN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/approve.html", 200, true); + +-- +2.7.4 + diff --git a/SPECS/libcmis.spec b/SPECS/libcmis.spec index ad94eb0..78aab5d 100644 --- a/SPECS/libcmis.spec +++ b/SPECS/libcmis.spec @@ -1,14 +1,13 @@ -%global apiversion 0.4 +%global apiversion 0.5 Name: libcmis -Version: 0.4.1 -Release: 5%{?dist} +Version: 0.5.1 +Release: 2%{?dist} Summary: A C++ client library for CM interfaces -Group: System Environment/Libraries License: GPLv2+ or LGPLv2+ or MPLv1.1 -URL: http://sourceforge.net/projects/libcmis/ -Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +URL: https://github.com/tdf/libcmis +Source: https://github.com/tdf/libcmis/releases/download/v%{version}/%{name}-%{version}.tar.gz BuildRequires: boost-devel BuildRequires: pkgconfig(cppunit) @@ -16,9 +15,11 @@ BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: xmlto -Patch0: 0001-Fix-int-bool-confusion-on-big-endian-architectures.patch -Patch1: 0001-coverity-return-const-string.patch -Patch2: 0001-fix-mismatching-exceptions.patch +Patch0: 0001-Add-new-Google-Drive-OAuth-2.0-login-procedure.patch +Patch1: 0002-Add-new-mokup-login-pages.patch +Patch2: 0003-Fix-test-in-test-factory.patch +Patch3: 0004-Fix-test-in-test-gdrive.patch +Patch4: 0005-Fix-test-in-test-onedrive.patch %description LibCMIS is a C++ client library for working with CM (content management) @@ -29,7 +30,6 @@ Another supported interface is Google Drive. %package devel Summary: Development files for %{name} -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel @@ -38,7 +38,6 @@ developing applications that use %{name}. %package tools Summary: Command line tool to access CMIS -Group: Applications/Publishing Requires: %{name}%{?_isa} = %{version}-%{release} %description tools @@ -50,7 +49,7 @@ command line. %build %configure --disable-silent-rules --disable-static --disable-werror \ - --disable-long-tests DOCBOOK2MAN='xmlto man' + DOCBOOK2MAN='xmlto man' sed -i \ -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ @@ -65,16 +64,12 @@ rm -f %{buildroot}/%{_libdir}/*.la %postun -p /sbin/ldconfig %check -# TODO: Something throws an unexpected libcmis::Exception, causing -# std::terminate. Investigate later when I have some time (and an arm -# box) -%ifnarch armv7hl export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -make check -%endif +make %{?_smp_mflags} check %files -%doc AUTHORS COPYING.* NEWS README +%doc AUTHORS NEWS +%license COPYING.* %{_libdir}/%{name}-%{apiversion}.so.* %{_libdir}/%{name}-c-%{apiversion}.so.* @@ -92,6 +87,20 @@ make check %{_mandir}/man1/cmis-client.1* %changelog +* Mon May 16 2016 David Tardon - 0.5.1-2 +- Resolves: rhbz#1330591 fix Google Drive login +- Related: rhbz#1330591 fix changelog entry + +* Fri Mar 04 2016 David Tardon - 0.5.1-1 +- Related: rhbz#1290152 new upstream release + +* Tue Mar 01 2016 David Tardon - 0.5.0-2 +- Related: rhbz#1290152 autoreconf is not needed +- Related: rhbz#1290152 add a bunch of fixes found by coverity + +* Mon Feb 22 2016 David Tardon - 0.5.0-1 +- Resolves: rhbz#1290152 rebase to 0.5.0 + * Fri Sep 05 2014 David Tardon - 0.4.1-5 - Related: rhbz#1132065 coverity: fix mismatching exceptions