Skip to content

Commit

Permalink
Hue - Upgrade Apache Thrift to 0.16.0, Thrift SASL 0.4.3, due to high…
Browse files Browse the repository at this point in the history
… CVEs (#3057)
  • Loading branch information
ranade1 authored Nov 10, 2022
1 parent 85ee523 commit b629542
Show file tree
Hide file tree
Showing 57 changed files with 591 additions and 180 deletions.
16 changes: 0 additions & 16 deletions desktop/core/ext-py/thrift-0.13.0/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions desktop/core/ext-py/thrift-0.13.0/MANIFEST.in

This file was deleted.

25 changes: 0 additions & 25 deletions desktop/core/ext-py/thrift-0.13.0/README.md

This file was deleted.

1 change: 1 addition & 0 deletions desktop/core/ext-py/thrift-0.16.0/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include src/ext/*
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
Metadata-Version: 2.1
Name: thrift
Version: 0.13.0
Version: 0.16.0
Summary: Python bindings for the Apache Thrift RPC system
Home-page: https://thrift.apache.org
Home-page: http://thrift.apache.org
Author: Apache Thrift Developers
Author-email: [email protected]
License: Apache Software License, Version 2
License: Apache License 2.0
Description: Thrift Python Software Library

Thrift is a lightweight, language-independent software stack for
point-to-point RPC implementation.
Thrift provides clean abstractions and implementations for data transport,
data serialization, and application level processing. The code generation
system takes a simple definition language as input and generates code
across programming languages that uses the abstracted stack to build
interoperable RPC clients and servers.
License
=======

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.

Using Thrift with Python
========================

Thrift is provided as a set of Python packages. The top level package is
thrift, and there are subpackages for the protocol, transport, and server
Expand All @@ -26,24 +41,17 @@ Description: Thrift Python Software Library
The Python libraries can be installed manually using the provided setup.py
file, or automatically using the install hook provided via autoconf/automake.
To use the latter, become superuser and do make install.

For more information:

https://thrift.apache.org/
https://www.github.com/apache/thrift/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Networking
Description-Content-Type: text/markdown
Provides-Extra: all
Provides-Extra: ssl
Provides-Extra: tornado
Provides-Extra: twisted
Provides-Extra: all
35 changes: 35 additions & 0 deletions desktop/core/ext-py/thrift-0.16.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Thrift Python Software Library

License
=======

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.

Using Thrift with Python
========================

Thrift is provided as a set of Python packages. The top level package is
thrift, and there are subpackages for the protocol, transport, and server
code. Each package contains modules using standard Thrift naming conventions
(i.e. TProtocol, TTransport) and implementations in corresponding modules
(i.e. TSocket). There is also a subpackage reflection, which contains
the generated code for the reflection structures.

The Python libraries can be installed manually using the provided setup.py
file, or automatically using the install hook provided via autoconf/automake.
To use the latter, become superuser and do make install.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[install]
optimize = 1

[metadata]
description_file = README.md

[flake8]
max-line-length = 100

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
# specific language governing permissions and limitations
# under the License.
#
import os
import sys

import sys
try:
from setuptools import setup, Extension
except Exception:
Expand All @@ -30,6 +29,7 @@
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError

# Fix to build sdist under vagrant
import os
if 'vagrant' in str(os.environ):
try:
del os.link
Expand All @@ -48,20 +48,6 @@ class BuildFailed(Exception):
pass


def read_file(path):
"""
Return the contents of a file
Arguments:
- path: path to the file
Returns:
- contents of the file
"""
with open(path, 'r') as desc_file:
return desc_file.read().rstrip()


class ve_build_ext(build_ext):
def run(self):
try:
Expand All @@ -76,11 +62,26 @@ def build_extension(self, ext):
raise BuildFailed()


def read_file(path):
"""
Return the contents of a file
Arguments:
- path: path to the file
Returns:
- contents of the file
"""
with open(path, "r") as desc_file:
return desc_file.read().rstrip()


def run_setup(with_binary):
if with_binary:
extensions = dict(
ext_modules=[
Extension('thrift.protocol.fastbinary',
extra_compile_args=['-std=c++11'],
sources=[
'src/ext/module.cpp',
'src/ext/types.cpp',
Expand All @@ -104,17 +105,15 @@ def run_setup(with_binary):
twisted_deps = ['twisted']

setup(name='thrift',
version='0.13.0',
version='0.16.0',
description='Python bindings for the Apache Thrift RPC system',
# causes problems publishing
# license=read_file("LICENSE"),
long_description=read_file("README.md"),
long_description_content_type="text/markdown",
author='Apache Thrift Developers',
author_email='[email protected]',
url='https://thrift.apache.org',
url='http://thrift.apache.org',
license='Apache License 2.0',
install_requires=['six>=1.7.2'],
license='Apache Software License, Version 2',
extras_require={
'ssl': ssl_deps,
'tornado': tornado_deps,
Expand All @@ -132,11 +131,9 @@ def run_setup(with_binary):
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Networking'
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# under the License.
#

import sys


class TType(object):
STOP = 0
Expand Down Expand Up @@ -90,18 +88,9 @@ def on_message_begin(self, func):
class TException(Exception):
"""Base class for all thrift exceptions."""

# BaseException.message is deprecated in Python v[2.6,3.0)
if (2, 6, 0) <= sys.version_info < (3, 0):
def _get_message(self):
return self._message

def _set_message(self, message):
self._message = message
message = property(_get_message, _set_message)

def __init__(self, message=None):
Exception.__init__(self, message)
self.message = message
super(TException, self).__setattr__("message", message)


class TApplicationException(TException):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

#define PY_SSIZE_T_CLEAN
#include "ext/binary.h"
namespace apache {
namespace thrift {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

#define PY_SSIZE_T_CLEAN
#include "ext/compact.h"

namespace apache {
Expand Down
Loading

0 comments on commit b629542

Please sign in to comment.