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

Add method to generate the contribution information from a token #313

Open
crisely09 opened this issue Jun 9, 2023 · 0 comments
Open

Add method to generate the contribution information from a token #313

crisely09 opened this issue Jun 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@crisely09
Copy link
Contributor

Add a method to generate automatically a contribution object with the shape:

    "type": "Contribution",
    "agent": {
        "id": f"https://bbp.epfl.ch/nexus/v1/realms/bbp/users/{decoded['preferred_username']}",
        "type": ["Agent", "Person"],
        "givenName": decoded["given_name"],
        "familyName": decoded["family_name"],
        "name": decoded["name"],
        "email": decoded["email"]
    }
})

where decoded is the Nexus decoded token:
decoded = jwt.decode(TOKEN, "secret", audience="https://slack.com", options={"verify_signature": False})

@crisely09 crisely09 added the enhancement New feature or request label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant