← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ilasc/lp-signing:inject-api into lp-signing:master

 

The proposal to merge ~ilasc/lp-signing:inject-api into lp-signing:master has been updated.

Description changed to:

There are 2 discussion points that I would need to go through before moving any further:
1: What do we want the "created_at" and "updated_at" on the Key object defined in lp_signing/model/key.py to be ?

a) the moments the are persisted / updated into lp-signing ?

b) the exact replica of the timestamps in LP for this Key - although I'm not sure what they are in LP as I couldn't find anything like that

2: Defining the input to /inject API
It depends what we want to do in LP:

a) assemble a Key object as defined in lp_signing/model/key.py and POST that to the /inject endpoint
Notes: For Unit Tests in this case we need to make the Key defined in lp_signing/model/key.py  JSON serializable (it isn't at the moment). Ideally I would think we would want to be able to construct a Key domain object in lp-signing and pass it through post_inject ot the test as if it was POSTed by LP into the endpoint - not possible at the moment and Key is not JSON serializable.


b) Change the input in the current /inject signature from this:
@validate_body({
    "type": "object",
    "properties": {
        "key-type": {
            "type": "string",
            "enum": [item.token for item in KeyType],
            },
        "lp-key": {"type": "string"},
        },
    "required": ["key-type", "lp-key"],
    })

to this content:
@validate_body({
    "type": "object",
    "properties": {
        "key-type": {
            "type": "string",
            "enum": [item.token for item in KeyType],
            },
        "private-key": {"type": "string"},
        "public-key": {"type": "string"},
        "fingerprint": {"type": "string"},
        },
    "required": ["key-type", "lp-key"],
    })

Depending on answers on 1 and 3 this might expand with timestamps and "LP mirrored flag".

3: Do we need to alter the Key object defined in lp_signing/model/key.py to reflect the fact that this is an "LP mirrored key" or do we not care at this point?

For more details, see:
https://code.launchpad.net/~ilasc/lp-signing/+git/lp-signing/+merge/378734
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ilasc/lp-signing:inject-api into lp-signing:master.


References