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

parsons[VAN] : Add NGP Introspection Endpoint #1180

Open
engelhartrueben opened this issue Oct 30, 2024 · 1 comment
Open

parsons[VAN] : Add NGP Introspection Endpoint #1180

engelhartrueben opened this issue Oct 30, 2024 · 1 comment
Labels
enhancement Impact - something should be added to or changed about Parsons that isn't causing a current breakage

Comments

@engelhartrueben
Copy link

I recently have come across this tool https://docs.ngpvan.com/reference/introspection by NGP VAN that has helped us check both the connection and the key permissions. It has been helpful when checking if a key has access to MyCampaigns, but not MyVoters, for instance.

Detailed Description

Add Introspection call to Parsons API. This method would take in the username and API Key, handle the conversion to base64, and make the introspection call to VAN. The response would return the JSON object, regardless of success or failure.

Context

This is important because it allows for a quick check of connection and permissions within a given application.

Possible Implementation

The script on the VAN Documentation suffices for my local setup (with some tweaks), but am not super familiar with the this repository.

import requests

url = "https://api.securevan.com/v4/apiKeyProfiles"

headers = {
     "accept": "application/json",
     "authorization": "Basic ****some base64 string ==****"
}

response = requests.get(url, headers=headers)

print(response.text)

Response:

{
    "items": [
        {
            "databaseName": "SmartVAN Massachusetts",
            "hasMyVoters": true,
            "hasMyCampaign": true,
            "committeeName": "People for Good",
            "apiKeyTypeName": "Custom Integration",
            "keyReference": "1234",
            "userFirstName": "peopleforgood",
            "userLastName": "api",
            "username": "peopleforgood.api",
          	"userId": 4321
        }
    ],
    "nextPageLink": null,
    "count": 1
}

Priority

Low priority, but helpful none the less (:

@engelhartrueben engelhartrueben added the enhancement Impact - something should be added to or changed about Parsons that isn't causing a current breakage label Oct 30, 2024
@austinweisgrau
Copy link
Collaborator

Oh nice yeah this would be cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Impact - something should be added to or changed about Parsons that isn't causing a current breakage
Projects
None yet
Development

No branches or pull requests

2 participants