Skip to content

Commit

Permalink
Preparing to release 2.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eandersson committed Sep 28, 2024
1 parent adddb35 commit fbfa6c4
Show file tree
Hide file tree
Showing 31 changed files with 55 additions and 61 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11.8, 3.12.3]
python-version: [3.11.9, 3.12.6]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -27,17 +27,17 @@ jobs:
- name: Start RabbitMQ
run: |
docker build -t amqpstormdev ./docker/
docker run -d --hostname rmq.amqpstorm.io --name amqpstormdev -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 amqpstormdev
docker run -d --hostname rmq.eandersson.net --name amqpstormdev -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 amqpstormdev
docker cp amqpstormdev:/etc/rabbitmq/ssl/ ./amqpstorm/tests/resources/
docker exec amqpstormdev wait-for-rabbitmq
echo "RabbitMQ Version: $(docker exec amqpstormdev rabbitmqctl --version)"
docker exec amqpstormdev rabbitmqctl add_user 'amqpstorm' '2a55f70a841f18b'
docker exec amqpstormdev rabbitmqctl -p / set_permissions 'amqpstorm' '.*' '.*' '.*'
docker exec amqpstormdev rabbitmqctl set_user_tags amqpstorm administrator
nc -zv rmq.amqpstorm.io 5671 || exit 1
nc -zv rmq.amqpstorm.io 5672 || exit 1
nc -zv rmq.amqpstorm.io 15671 || exit 1
nc -zv rmq.amqpstorm.io 15672 || exit 1
nc -zv rmq.eandersson.net 5671 || exit 1
nc -zv rmq.eandersson.net 5672 || exit 1
nc -zv rmq.eandersson.net 15671 || exit 1
nc -zv rmq.eandersson.net 15672 || exit 1
- name: Lint with flake8
run: |
flake8 .
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 2.11.0
- Replace select.select with select.poll on Linux by default.
- Replace list with collections.deque - Thanks Bernhard Thiel.
- Removed unnecessary lock when building messages.
- Fixed various Python 2.7 tests.

Version 2.10.8
--------------
Expand Down
6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ AMQPStorm is a library designed to be consistent, stable and thread-safe.
- Supports Python 2.7 and Python 3.6+.
- Fully tested against Python Implementations; CPython and PyPy.

Documentation
=============

Additional documentation is available on `amqpstorm.io <https://www.amqpstorm.io>`_.

Changelog
=========

Expand All @@ -25,6 +20,7 @@ Version 2.11.0
- Replace select.select with select.poll on Linux by default.
- Replace list with collections.deque - Thanks Bernhard Thiel.
- Removed unnecessary lock when building messages.
- Fixed various Python 2.7 tests.

Version 2.10.8
--------------
Expand Down
2 changes: 1 addition & 1 deletion amqpstorm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""AMQPStorm."""
__version__ = '2.11.0rc1' # noqa
__version__ = '2.11.0' # noqa
__author__ = 'eandersson' # noqa

import logging
Expand Down
4 changes: 2 additions & 2 deletions amqpstorm/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class Connection(Stateful):
import amqpstorm
ssl_options = {
'context': ssl.create_default_context(cafile='ca_certificate.pem'),
'server_hostname': 'rmq.amqpstorm.io',
'server_hostname': 'rmq.eandersson.net',
'check_hostname': True, # New 2.8.0, default is False
'verify_mode': 'required', # New 2.8.0, default is 'none'
}
connection = amqpstorm.Connection(
'rmq.amqpstorm.io', 'guest', 'guest', port=5671,
'rmq.eandersson.net', 'guest', 'guest', port=5671,
ssl=True, ssl_options=ssl_options
)
Expand Down
2 changes: 1 addition & 1 deletion amqpstorm/management/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ManagementApi(object):
read_regex='.*'
)
:param str api_url: RabbitMQ Management url (e.g. https://rmq.amqpstorm.io:15671)
:param str api_url: RabbitMQ Management url (e.g. https://rmq.eandersson.net:15671)
:param str username: Username (e.g. guest)
:param str password: Password (e.g. guest)
:param int,float timeout: TCP Timeout
Expand Down
12 changes: 6 additions & 6 deletions amqpstorm/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

HOST = os.environ.get(
'AMQP_HOST',
'rmq.amqpstorm.io'
'rmq.eandersson.net'
)
USERNAME = os.environ.get(
'AMQP_USERNAME',
Expand All @@ -16,23 +16,23 @@
)
URI = os.environ.get(
'AMQP_URI',
'amqp://{0}:{1}@rmq.amqpstorm.io:5672/%2F'.format(USERNAME, PASSWORD)
'amqp://{0}:{1}@rmq.eandersson.net:5672/%2F'.format(USERNAME, PASSWORD)
)
HTTP_URL = os.environ.get(
'AMQP_HTTP_URL',
'http://rmq.amqpstorm.io:15672'
'http://rmq.eandersson.net:15672'
)
HTTPS_URL = os.environ.get(
'AMQP_HTTP_URL',
'https://rmq.amqpstorm.io:15671'
'https://rmq.eandersson.net:15671'
)
SSL_URI = os.environ.get(
'AMQP_SSL_URI',
'amqps://{0}:{1}@rmq.amqpstorm.io:5671/%2F'.format(USERNAME, PASSWORD)
'amqps://{0}:{1}@rmq.eandersson.net:5671/%2F'.format(USERNAME, PASSWORD)
)
SSL_HOST = os.environ.get(
'AMQP_SSL_HOST',
'rmq.amqpstorm.io'
'rmq.eandersson.net'
)
CAFILE = os.environ.get(
'AMQP_CAFILE',
Expand Down
8 changes: 4 additions & 4 deletions amqpstorm/tests/functional/management/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ def test_api_cluster_name(self):

self.assertIsInstance(result, dict)
self.assertIn('name', result)
self.assertEqual('rabbit@rmq.amqpstorm.io', result['name'])
self.assertEqual('rabbit@rmq.eandersson.net', result['name'])

def test_api_nodes(self):
api = ManagementApi(HTTP_URL, USERNAME, PASSWORD)
result = api.nodes()

self.assertIsInstance(result, list)
self.assertTrue(result)
self.assertEqual('rabbit@rmq.amqpstorm.io', result[0]['name'])
self.assertEqual('rabbit@rmq.eandersson.net', result[0]['name'])

def test_api_node(self):
api = ManagementApi(HTTP_URL, USERNAME, PASSWORD)
result = api.node('rabbit@rmq.amqpstorm.io')
result = api.node('rabbit@rmq.eandersson.net')

self.assertIsInstance(result, dict)
self.assertTrue(result)
self.assertEqual('rabbit@rmq.amqpstorm.io', result['name'])
self.assertEqual('rabbit@rmq.eandersson.net', result['name'])

def test_api_whoami(self):
api = ManagementApi(HTTP_URL, USERNAME, PASSWORD)
Expand Down
4 changes: 2 additions & 2 deletions amqpstorm/tests/unit/uri_connection/test_uri_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ def test_uri_get_ssl_options_new_method(self):
}
connection = UriConnection(
'amqps://guest:guest@localhost:5671/%2F?'
'server_hostname=rmq.amqpstorm.io&certfile=file.crt',
'server_hostname=rmq.eandersson.net&certfile=file.crt',
ssl_options=ssl_kwargs,
lazy=True
)

ssl_options = connection.parameters.get('ssl_options')

self.assertEqual(ssl_options['server_hostname'], 'rmq.amqpstorm.io')
self.assertEqual(ssl_options['server_hostname'], 'rmq.eandersson.net')
self.assertEqual(ssl_options['cert_reqs'], ssl.CERT_REQUIRED)
self.assertEqual(ssl_options['ssl_version'], ssl.PROTOCOL_TLSv1)
self.assertEqual(ssl_options['keyfile'], 'file.key')
Expand Down
4 changes: 2 additions & 2 deletions amqpstorm/uri_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class UriConnection(Connection):
import amqpstorm
ssl_options = {
'context': ssl.create_default_context(cafile='ca_certificate.pem'),
'server_hostname': 'rmq.amqpstorm.io'
'server_hostname': 'rmq.eandersson.net'
}
connection = amqpstorm.UriConnection(
'amqps://guest:guest@rmq.amqpstorm.io:5671/%2F?heartbeat=60',
'amqps://guest:guest@rmq.eandersson.net:5671/%2F?heartbeat=60',
ssl_options=ssl_options
)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ COPY ./files/generate-certs /etc/rabbitmq/ssl/generate-certs
COPY ./files/openssl.cnf /etc/rabbitmq/ssl/openssl.cnf

RUN /etc/rabbitmq/ssl/generate-certs && \
chown -R rabbitmq.rabbitmq /etc/rabbitmq/ssl/*
chown -R rabbitmq:rabbitmq /etc/rabbitmq/ssl/*
6 changes: 3 additions & 3 deletions docker/files/generate-certs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ echo 01 > /etc/rabbitmq/ssl/serial
touch /etc/rabbitmq/ssl/index.txt

cd /etc/rabbitmq/ssl/
openssl req -x509 -config openssl.cnf -newkey rsa:4096 -days 365 -out ca_certificate.pem -outform PEM -subj /CN=rmq.amqpstorm.io/ -nodes
openssl req -x509 -config openssl.cnf -newkey rsa:4096 -days 365 -out ca_certificate.pem -outform PEM -subj /CN=rmq.eandersson.net/ -nodes
openssl x509 -in ca_certificate.pem -out ca_certificate.cer -outform DER

cd /etc/rabbitmq/ssl/server
openssl genrsa -out private_key.pem 4096
openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=rmq.amqpstorm.io/O=server/ -nodes
openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=rmq.eandersson.net/O=server/ -nodes

cd /etc/rabbitmq/ssl/
openssl ca -config openssl.cnf -in server/req.pem -out server/server_certificate.pem -notext -batch -extensions server_ca_extensions

cd /etc/rabbitmq/ssl/client
openssl genrsa -out private_key.pem 4096
openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=rmq.amqpstorm.io/O=client/ -nodes
openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=rmq.eandersson.net/O=client/ -nodes

cd /etc/rabbitmq/ssl/
openssl ca -config openssl.cnf -in client/req.pem -out client/client_certificate.pem -notext -batch -extensions client_ca_extensions
2 changes: 1 addition & 1 deletion docker/files/openssl.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ extendedKeyUsage = 1.3.6.1.5.5.7.3.2
basicConstraints = CA:false
keyUsage = digitalSignature,keyEncipherment
extendedKeyUsage = 1.3.6.1.5.5.7.3.1
subjectAltName = DNS:rmq.amqpstorm.io
subjectAltName = DNS:rmq.eandersson.net
4 changes: 2 additions & 2 deletions docker/files/wait-for-rabbitmq
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
while [ ! -f /var/lib/rabbitmq/mnesia/rabbit@rmq.amqpstorm.io.pid ]; do sleep 1; done
rabbitmqctl --timeout 16 wait /var/lib/rabbitmq/mnesia/rabbit@rmq.amqpstorm.io.pid --longnames
while [ ! -f /var/lib/rabbitmq/mnesia/rabbit@rmq.eandersson.net.pid ]; do sleep 1; done
rabbitmqctl --timeout 16 wait /var/lib/rabbitmq/mnesia/rabbit@rmq.eandersson.net.pid --longnames
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Basic Example

::

with amqpstorm.Connection('rmq.amqpstorm.io', 'guest', 'guest') as connection:
with amqpstorm.Connection('rmq.eandersson.net', 'guest', 'guest') as connection:
with connection.channel() as channel:
channel.queue.declare('fruits')
message = amqpstorm.Message.create(
Expand Down
2 changes: 1 addition & 1 deletion examples/management/aliveness_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
result = API.aliveness_test('/')
Expand Down
2 changes: 1 addition & 1 deletion examples/management/create_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
API.user.create('my_user', 'password', tags='administrator')
Expand Down
2 changes: 1 addition & 1 deletion examples/management/create_virtual_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
# Create a new Virtual Host called 'travis_ci'.
Expand Down
2 changes: 1 addition & 1 deletion examples/management/declare_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
API.queue.declare('my_queue', virtual_host='/')
Expand Down
2 changes: 1 addition & 1 deletion examples/management/delete_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
API.queue.delete('my_queue', virtual_host='/')
Expand Down
2 changes: 1 addition & 1 deletion examples/management/delete_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
API.user.delete('my_user')
Expand Down
2 changes: 1 addition & 1 deletion examples/management/does_queue_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
API.queue.declare('my_queue', virtual_host='/', passive=True)
Expand Down
2 changes: 1 addition & 1 deletion examples/management/get_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
API.user.create('my_user', 'password')

Expand Down
2 changes: 1 addition & 1 deletion examples/management/list_queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)

print('List all queues.')
Expand Down
2 changes: 1 addition & 1 deletion examples/management/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
result = API.overview()
Expand Down
2 changes: 1 addition & 1 deletion examples/management/whoami.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amqpstorm.io:15671', 'guest',
API = management.ManagementApi('https://rmq.eandersson.net:15671', 'guest',
'guest', verify=True)
try:
result = API.whoami()
Expand Down
2 changes: 1 addition & 1 deletion examples/pool/pool_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import amqpstorm
import amqpstorm_pool

uri = 'amqp://guest:guest@rmq.amqpstorm.io:5672/%2F?heartbeat=60'
uri = 'amqp://guest:guest@rmq.eandersson.net:5672/%2F?heartbeat=60'
pool = amqpstorm_pool.QueuedPool(
create=lambda: amqpstorm.UriConnection(uri),
max_size=10,
Expand Down
4 changes: 2 additions & 2 deletions examples/pool/ssl_pool_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
)
ssl_options = {
'context': context,
'server_hostname': 'rmq.amqpstorm.io'
'server_hostname': 'rmq.eandersson.net'
}

uri = 'amqps://guest:guest@rmq.amqpstorm.io:5671/%2F?heartbeat=60'
uri = 'amqps://guest:guest@rmq.eandersson.net:5671/%2F?heartbeat=60'
pool = amqpstorm_pool.QueuedPool(
create=lambda: amqpstorm.UriConnection(uri, ssl_options=ssl_options),
max_size=10,
Expand Down
4 changes: 2 additions & 2 deletions examples/ssl_with_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def on_message(message):
)
SSL_OPTIONS = {
'context': CONTEXT,
'server_hostname': 'rmq.amqpstorm.io'
'server_hostname': 'rmq.eandersson.net'
}

with Connection('rmq.amqpstorm.io', 'guest', 'guest', port=5671,
with Connection('rmq.eandersson.net', 'guest', 'guest', port=5671,
ssl=True, ssl_options=SSL_OPTIONS) as connection:
with connection.channel() as channel:
# Declare the Queue, 'simple_queue'.
Expand Down
Loading

0 comments on commit fbfa6c4

Please sign in to comment.