Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: GenericRelation for Secrets #2351

Closed
wants to merge 69 commits into from

Conversation

AndyGauge
Copy link

Fixes: #1503

This change replaces the Device Foreign Key with a GenericRelationship that allows extending the scope of Secrets. Currently there are test failures for the API updating devices. This work does not include extending the Secrets to any additional objects, yet. This is an example output from the api:

{
    "id": 1,
    "object": {
        "id": 1,
        "url": "http://localhost:8000/api/dcim/devices/1/",
        "name": "a",
        "display_name": "a",
        "class": "device"
    },
    "role": {
        "id": 1,
        "url": "http://localhost:8000/api/secrets/secret-roles/1/",
        "name": "Login Credentials",
        "slug": "login-credentials"
    },
    "name": "ab",
    "plaintext": "--",
    "hash": "------",
    "tags": [],
    "custom_fields": {},
    "created": "2018-08-10",
    "last_updated": "2018-08-10T18:00:23.899052Z"
}

The 'device' node is replaced with 'object' which includes the 'class' of 'device'

jeremystretch and others added 17 commits December 7, 2017 14:52
@AndyGauge
Copy link
Author

I'll address the formatting errors in the test, I'm having problem figuring out how to accept an object through the Serializers. My test failures say object required field. We cannot pass an object directly, but instead an object_id and content_type

@AndyGauge
Copy link
Author

Ever seen CI fail with psycopg2.OperationalError: FATAL: database "netbox" does not exist

shouldn't CI be running against netbox_test?

@jeremystretch
Copy link
Member

Closing this out due to lack of activity. Might take another look at this for v2.6.

@AndyGauge
Copy link
Author

AndyGauge commented Nov 6, 2018 via email

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the assignment of secrets to objects other than devices
3 participants