Please Ensure Kinto Staging Environment QA Collection Configured Correctly For Signing

RESOLVED FIXED

Status

Cloud Services
QA: Test Automation
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: grumpy, Assigned: phrawzty)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
During the Kinto work-week in NYC I asked :natim and :phrawzty to make sure that the staging environment for Kinto was configured correctly with a collection that I can use to write tests that verify signing of collections happens correctly.

This is the collection I wanted to use:

https://kinto-writer.stage.mozaws.net/v1/buckets/staging/collections/qa

I'm under the impression that the following work flow should work:

1. Add a record to this collection using the latest client
2. Send a PATCH request that the data be signed by setting status to be 'to-sign'
3. Use a script provided in kinto/kinto-signer that verifies the signatures are valid

I was able to do steps 1 and 2 but when I use the script that verifies signatures I get an error message that the there is no signature field in the response.

Here's the code I am currently using:

def test_signatures_after_modifying_collection(env, conf):
    # Define our initial collection
    data = {'foo': 1, 'bar': 2, 'baz': 'biff'}
    client = Client(
        server_url=conf.get(env, 'writer_server'),
        auth=('qa', '<redacted>'),
        bucket='staging',
        collection='qa'
    )
    data = client.create_record(data=data)
    client.patch_collection(data={'status': 'to-sign'})
    data = client.get_collection()
    signature = data['data']['signature']

    assert signature is not None

I get the following error:

_____________________________________________ test_signatures_after_modifying_collection ______________________________________________

env = 'stage', conf = <ConfigParser.ConfigParser instance at 0x10f0745a8>

    def test_signatures_after_modifying_collection(env, conf):
        # Define our initial collection
        data = {'foo': 1, 'bar': 2, 'baz': 'biff'}
        client = Client(
            server_url=conf.get(env, 'writer_server'),
            auth=('qa', '<redacted>'),
            bucket='staging',
            collection='qa'
        )
        data = client.create_record(data=data)
        client.patch_collection(data={'status': 'to-sign'})
        data = client.get_collection()
>       signature = data['data']['signature']
E       KeyError: 'signature'

Connecting to the collection requires VPN access, which I have and are using during testing.
To validate the signature you need to use this URL: https://kinto.stage.mozaws.net/v1/buckets/blocklists/collections/qa
The way the signer works is the following:

- You create a record in the /buckets/staging/collections/qa
- You ask for signature in /buckets/staging/collections/qa
- Records are synced and signed in /buckets/blocklists/collections/qa
(Reporter)

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.