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 support for IAMServiceAccountCredentials API #54

Merged

Conversation

owainhunt
Copy link

Adds support for the IAM Service Account Credentials API, specifically the signJwt endpoint.

Usage:

func signJWT() {
    let client = try IAMServiceAccountCredentialsClient(credentials: credentialsConfiguration,
                                           config: IAMServiceAccountCredentialsConfiguration,
                                           httpClient: client,
                                           eventLoop: myEventLoop)

    let payload: JWTPayload = MyPayload(name: "key", value: "value")

    client.api.signJWT(payload, serviceAccount: "[email protected]").map { response in
        print(response.signedJwt) // Prints JWT signed with the given service account's credentials 
    }
}

@owainhunt
Copy link
Author

cc @nathanfallet @Andrewangeta

@nathanfallet nathanfallet merged commit aba2423 into vapor-community:main Apr 19, 2024
@owainhunt
Copy link
Author

@nathanfallet can we get the tags mentioned in #53 set up please (or at least the 1.0) - I've got a corresponding PR ready to go for #54 that wraps this new functionality in vapor-community/google-cloud but it needs a tag to point to 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants