Skip to content

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.

4 participants