[qpid-proton] branch master updated: PROTON-2258: mark pn_work_head(), pn_work_next(), and Python equivalents as deprecated.

2020-08-06 Thread cliffjansen
This is an automated email from the ASF dual-hosted git repository.

cliffjansen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
 new ee88029  PROTON-2258: mark pn_work_head(), pn_work_next(), and Python 
equivalents as deprecated.
ee88029 is described below

commit ee880294923cdf81a0f693282dde6df1e320b599
Author: Cliff Jansen 
AuthorDate: Thu Aug 6 17:03:03 2020 -0700

PROTON-2258: mark pn_work_head(), pn_work_next(), and Python equivalents as 
deprecated.
---
 c/include/proton/delivery.h | 2 ++
 c/src/core/engine.c | 5 +
 python/cproton.i| 4 
 python/proton/_delivery.py  | 4 +++-
 python/proton/_endpoints.py | 4 +++-
 5 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/c/include/proton/delivery.h b/c/include/proton/delivery.h
index ec034e9..118fbf6 100644
--- a/c/include/proton/delivery.h
+++ b/c/include/proton/delivery.h
@@ -328,6 +328,7 @@ PN_EXTERN bool pn_delivery_buffered(pn_delivery_t 
*delivery);
  * @return the first delivery object that needs to be serviced, else
  * NULL if none
  */
+PN_DEPRECATED("Use the PN_DELIVERY event to track deliveries with pending 
operations")
 PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t *connection);
 
 /**
@@ -339,6 +340,7 @@ PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t 
*connection);
  * @return the next delivery that has pending operations, else
  * NULL if none
  */
+PN_DEPRECATED("Use the PN_DELIVERY event to track deliveries with pending 
operations")
 PN_EXTERN pn_delivery_t *pn_work_next(pn_delivery_t *delivery);
 
 /**
diff --git a/c/src/core/engine.c b/c/src/core/engine.c
index 02062f6..e1a6610 100644
--- a/c/src/core/engine.c
+++ b/c/src/core/engine.c
@@ -19,6 +19,9 @@
  *
  */
 
+/* for pn_work_head and related deprecations */
+#define PN_USE_DEPRECATED_API 1
+
 #include "engine-internal.h"
 
 #include "framing.h"
@@ -2407,3 +2410,5 @@ const char *pn_disposition_type_name(uint64_t d) {
default: return "unknown";
   }
 }
+
+#undef PN_USE_DEPRECATED_API
diff --git a/python/cproton.i b/python/cproton.i
index 0dcc2ce..2a7bff9 100644
--- a/python/cproton.i
+++ b/python/cproton.i
@@ -22,6 +22,10 @@
 #if defined(_WIN32) && ! defined(__CYGWIN__)
 #include 
 #endif
+
+/* TODO: Remove once pn_work_head() and related have been removed from Proton 
*/
+#define PN_USE_DEPRECATED_API 1
+
 #include 
 #include 
 #include 
diff --git a/python/proton/_delivery.py b/python/proton/_delivery.py
index f5c955f..0f871cf 100644
--- a/python/proton/_delivery.py
+++ b/python/proton/_delivery.py
@@ -445,7 +445,9 @@ class Delivery(Wrapper):
 
 @property
 def work_next(self):
-"""
+"""Deprecated: use on_message(), on_accepted(), on_rejected(),
+on_released(), and on_settled() instead.
+
 The next :class:`Delivery` on the connection that has pending
 operations.
 
diff --git a/python/proton/_endpoints.py b/python/proton/_endpoints.py
index 50cf677..e528de6 100644
--- a/python/proton/_endpoints.py
+++ b/python/proton/_endpoints.py
@@ -472,7 +472,9 @@ class Connection(Wrapper, Endpoint):
 
 @property
 def work_head(self):
-"""
+"""Deprecated: use on_message(), on_accepted(), on_rejected(),
+on_released(), and on_settled() instead.
+
 Extracts the first delivery on the connection that has pending
 operations.
 


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] branch master updated: QPID-8460 [Broker-j] Do not expose private information to exception message (#55)

2020-08-06 Thread rgodfrey
This is an automated email from the ASF dual-hosted git repository.

rgodfrey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/master by this push:
 new 734fb39  QPID-8460 [Broker-j] Do not expose private information to 
exception message (#55)
734fb39 is described below

commit 734fb3994f74ae066b587d3563322f10e47e6727
Author: vavrtom 
AuthorDate: Thu Aug 6 23:41:42 2020 +0200

QPID-8460 [Broker-j] Do not expose private information to exception message 
(#55)

* QPID-8460 Do not expose private information to exception message

* Implemented review comments

Co-authored-by: Tomas Vavricka 
---
 .../server/model/ConfiguredAutomatedAttribute.java |  3 +-
 .../AbstractScramAuthenticationManager.java| 24 +---
 .../crammd5/CramMd5Base64HashedNegotiator.java | 25 +++-
 .../sasl/crammd5/CramMd5Base64HexNegotiator.java   | 33 +-
 .../java/org/apache/qpid/server/util/Strings.java  | 24 +---
 .../auth/BasicAuthPreemptiveAuthenticator.java | 24 
 6 files changed, 70 insertions(+), 63 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredAutomatedAttribute.java
 
b/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredAutomatedAttribute.java
index a5b3598..d98a96f 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredAutomatedAttribute.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredAutomatedAttribute.java
@@ -255,7 +255,8 @@ public class ConfiguredAutomatedAttribute  extend
 Type returnType = getGetter().getGenericReturnType();
 String simpleName = returnType instanceof Class ? ((Class) 
returnType).getSimpleName() : returnType.toString();
 
-throw new IllegalArgumentException("Cannot convert '" + value
+throw new IllegalArgumentException("Cannot convert '" +
+   (isSecure() ? 
AbstractConfiguredObject.SECURED_STRING_VALUE : value)
+ "' into a " + simpleName
+ " for attribute " + getName()
+ " (" + iae.getMessage() + 
")", iae);
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractScramAuthenticationManager.java
 
b/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractScramAuthenticationManager.java
index e8bb81e..abc6cbf 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractScramAuthenticationManager.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractScramAuthenticationManager.java
@@ -159,17 +159,18 @@ public abstract class 
AbstractScramAuthenticationManager
+{
+final byte[] passwordBytes = Strings.decodePrivateBase64(new 
String(passwordData), "CRAM MD5 hashed password");
+final char[] password = new char[passwordBytes.length];
+for (int i = 0; i < passwordBytes.length; i++)
+{
+password[i] = (char) passwordBytes[i];
+}
+return password;
+};
 
 public CramMd5Base64HashedNegotiator(final 
PasswordCredentialManagingAuthenticationProvider authenticationProvider,
  final String localFQDN,
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CramMd5Base64HexNegotiator.java
 
b/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CramMd5Base64HexNegotiator.java
index 22fc95c..edcbff5 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CramMd5Base64HexNegotiator.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CramMd5Base64HexNegotiator.java
@@ -27,26 +27,19 @@ import org.apache.qpid.server.util.Strings;
 public class CramMd5Base64HexNegotiator extends AbstractCramMd5Negotiator
 {
 public static final String MECHANISM = "CRAM-MD5-HEX";
-private static final PasswordTransformer BASE64_HEX_PASSWORD_TRANSFORMER =
-new PasswordTransformer()
-{
-private final char[] HEX_CHARACTERS =
-{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 
'a', 'b', 'c', 'd', 'e', 'f'};
-
-@Override
-public char[] transform(final char[] passwordData)
-{
-byte[] passwordBytes = Strings.decodeBase64(new 
String(passwordData));
-char[] password = new char[passwordBytes.length * 2];
-
-for (int i = 0; i < passwordBytes.length; i++)
-{
-password[2 * i] = HEX_CHARACTERS[(((int) 
passwordBytes[i]

[qpid-dispatch] branch master updated: DISPATCH-1720, DISPATCH-1739: move console tests + lint check jobs into the main 'build' workflow, add a RAT check job

2020-08-06 Thread robbie
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
 new 34e4091  DISPATCH-1720, DISPATCH-1739: move console tests + lint check 
jobs into the main 'build' workflow, add a RAT check job
34e4091 is described below

commit 34e40915c92b995dbf15122b98345eaf02c0e4ce
Author: Robbie Gemmell 
AuthorDate: Thu Aug 6 16:43:32 2020 +0100

DISPATCH-1720, DISPATCH-1739: move console tests + lint check jobs into the 
main 'build' workflow, add a RAT check job

This closes #813
---
 .github/workflows/build.yaml   | 51 ++
 .github/workflows/console.yaml | 50 -
 2 files changed, 51 insertions(+), 50 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index ebfba60..5e21197 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -197,3 +197,54 @@ jobs:
   name: 
cores_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}_${{matrix.shard}}
   path: |
 **/core
+
+  console-test:
+name: Console Tests
+runs-on: ubuntu-latest
+steps:
+  - uses: actions/checkout@v2
+
+  - name: Install Dependencies
+run: cd console/react && npm ci
+
+  - name: Run Tests
+run: cd console/react && npm run test
+
+  console-eslint:
+name: Console ESLint
+runs-on: ubuntu-latest
+steps:
+  - uses: actions/checkout@v2
+
+  - name: Install Dependencies
+run: cd console/react && npm ci
+
+  - name: Install Typescript
+run: cd console/react && npm install typescript
+
+  - name: Run ESLint
+run: cd console/react && npx eslint --max-warnings 0 .
+
+  rat_check:
+name: RAT Check
+runs-on: ubuntu-latest
+steps:
+  - uses: actions/checkout@v2
+  - uses: actions/cache@v2
+with:
+  path: ~/.m2/repository
+  key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+  restore-keys: |
+${{ runner.os }}-maven-
+
+  - name: Install JDK ${{ matrix.java }}
+uses: actions/setup-java@v1
+with:
+  java-version: 11
+
+  - name: RAT Check
+run: mvn apache-rat:check
+
+  - name: Output
+if: ${{ ! cancelled() }}
+run: cat target/rat.txt || echo "Unable to print output"
diff --git a/.github/workflows/console.yaml b/.github/workflows/console.yaml
deleted file mode 100644
index 63ff30b..000
--- a/.github/workflows/console.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-name: "Console"
-
-on: [push, pull_request]
-
-jobs:
-  test:
-name: Tests
-runs-on: ubuntu-latest
-steps:
-  - uses: actions/checkout@v2
-
-  - name: Install Dependencies
-run: cd console/react && npm ci
-
-  - name: Run Tests
-run: cd console/react && npm run test
-
-  eslint:
-name: ESLint
-runs-on: ubuntu-latest
-steps:
-  - uses: actions/checkout@v2
-
-  - name: Install Dependencies
-run: cd console/react && npm ci
-
-  - name: Install Typescript
-run: cd console/react && npm install typescript
-
-  - name: Run ESLint
-run: cd console/react && npx eslint --max-warnings 0 .


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] branch master updated (4088ccc -> 16ac2c5)

2020-08-06 Thread robbie
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.


from 4088ccc  DISPATCH-1720: use `npm ci` because it's appropriate and 
faster than `npm install` (#812)
 new 90ffb04  DISPATCH-1739 Add -DUSE_BWRAP option, defaulting to OFF
 new 16ac2c5  DISPATCH-1739 Add GitHub Action w/ sharding and bubblewrap

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/build.yaml | 199 +++
 tests/CMakeLists.txt |  13 ++-
 2 files changed, 211 insertions(+), 1 deletion(-)
 create mode 100644 .github/workflows/build.yaml


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] 01/02: DISPATCH-1739 Add -DUSE_BWRAP option, defaulting to OFF

2020-08-06 Thread robbie
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 90ffb042ef0d117a494b52d7d64285096593342e
Author: Jiri Danek 
AuthorDate: Sun Aug 2 21:39:48 2020 +0200

DISPATCH-1739 Add -DUSE_BWRAP option, defaulting to OFF

Bubblewrap (https://github.com/containers/bubblewrap) is
an unprivileged sandbox. It allows running tests in parallel,
without any port clashes with already running servers.
---
 tests/CMakeLists.txt | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 08df007..e00ed84 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -64,7 +64,18 @@ target_link_libraries(test-receiver ${Proton_LIBRARIES})
 add_executable(clogger clogger.c)
 target_link_libraries(clogger ${Proton_LIBRARIES})
 
-set(TEST_WRAP ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/run.py)
+# Bubblewrap is an unprivileged sandboxing tool for Linux. Setting 
--unshare-net allows
+# running tests in parallel (the ctest -j option) without port clashes
+set(USE_BWRAP OFF CACHE BOOL "Wrap test executions with bwrap 
(https://github.com/containers/bubblewrap)")
+if(USE_BWRAP)
+  # Inaccessible DNS servers produce "proton:io Temporary failure in name 
resolution".
+  # For system_tests_bad_configuration we need to get "proton:io Name or 
service not known",
+  # so blank /etc/nsswitch.conf to achieve that.
+  set(BWRAP_ARGS bwrap --bind / / --bind /dev/zero /etc/nsswitch.conf 
--unshare-net --dev /dev --die-with-parent --)
+else()
+  set(BWRAP_ARGS "")
+endif()
+set(TEST_WRAP ${BWRAP_ARGS} ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_BINARY_DIR}/run.py)
 
 add_test(unit_tests_size_1 ${TEST_WRAP} unit_tests_size 1)
 add_test(unit_tests_size_512   ${TEST_WRAP} unit_tests_size 512)


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] 02/02: DISPATCH-1739 Add GitHub Action w/ sharding and bubblewrap

2020-08-06 Thread robbie
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 16ac2c5032c23e6430a1e41d6ff28078c5a17fcc
Author: Jiri Danek 
AuthorDate: Sun Aug 2 21:46:10 2020 +0200

DISPATCH-1739 Add GitHub Action w/ sharding and bubblewrap

This is a CI job triggered by pushes and pull requests sent to GitHub.

Output artifacts include parts of the workspace before running tests; this 
is
what the machines running test shards get. At the end, each shard outputs
a XML CTest report.

Note that `ctest -j2` results in test log lines being mixed up in stdout.
Refer to the output XML report or use grep (grep for lines starting with
the test number) to get understandable log.

* Using python 3.6 as this is the version that works on all platforms 
tested.
* Using two shards with -j2, which should balance speed and convenience.
* Using ccache w/ 400MB size limit, to avoid purges during the build.

This closes #809
---
 .github/workflows/build.yaml | 199 +++
 1 file changed, 199 insertions(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 000..ebfba60
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,199 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+  compile:
+name: "Compile (${{matrix.os}}, ${{matrix.runtimeCheck}})"
+runs-on: ${{ matrix.os }}
+strategy:
+  fail-fast: false
+  matrix:
+os: [ubuntu-20.04]
+buildType: [RelWithDebInfo]
+runtimeCheck: [asan]
+env:
+  BuildType: ${{matrix.buildType}}
+  ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
+  DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
+  InstallPrefix: ${{github.workspace}}/install
+
+  ProtonCMakeExtraArgs: '-DCMAKE_C_COMPILER_LAUNCHER=ccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_BINDINGS=python 
-DRUNTIME_CHECK=${{matrix.runtimeCheck}}'
+  DispatchCMakeExtraArgs: '-DCMAKE_C_COMPILER_LAUNCHER=ccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCONSOLE_INSTALL=OFF 
-DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG -DRUNTIME_CHECK=${{matrix.runtimeCheck}}'
+
+  CCACHE_BASEDIR: ${{github.workspace}}
+  CCACHE_DIR: ${{github.workspace}}/.ccache
+  CCACHE_COMPRESS: 'true'
+  CCACHE_MAXSIZE: '400MB'
+steps:
+
+  - name: Show environment (Linux)
+if: ${{ always() && runner.os == 'Linux' }}
+run: env -0 | sort -z | tr '\0' '\n'
+
+  - uses: actions/checkout@v2
+with:
+  repository: 'apache/qpid-proton'
+  ref: 'master'
+  path: 'qpid-proton'
+
+  - uses: actions/checkout@v2
+with:
+  path: 'qpid-dispatch'
+
+  # 
https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
+  - name: Prepare ccache timestamp
+id: ccache_cache_timestamp
+shell: cmake -P {0}
+run: |
+  string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
+  message("::set-output name=timestamp::${current_date}")
+
+  - uses: actions/cache@v2
+env:
+  cache-name: cache-ccache
+with:
+  path: .ccache
+  key: ${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name 
}}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
+  restore-keys: |
+${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name }}
+
+  - name: Create Build and Install directories
+run: mkdir -p "${ProtonBuildDir}" "${DispatchBuildDir}" 
"{InstallPrefix}"
+
+  - name: Setup python
+uses: actions/setup-python@v2
+with:
+  python-version: 3.6
+  architecture: x64
+
+  - name: Install python dependencies
+run: python -m pip install setuptools wheel tox
+
+  - name: Install Linux dependencies
+if: ${{ runner.os == 'Linux' }}
+run: |
+  sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev 
libwebsockets-dev ccache ninja-build pixz
+
+