Kong

v4.5.0 published on Tuesday, Mar 29, 2022 by Pulumi

ConsumerJwtAuth

# kong.ConsumerJwtAuth

Consumer jwt auth is a resource that allows you to configure the jwt auth plugin for a consumer.

Example Usage

using Pulumi;
using Kong = Pulumi.Kong;

class MyStack : Stack
{
    public MyStack()
    {
        var myConsumer = new Kong.Consumer("myConsumer", new Kong.ConsumerArgs
        {
            CustomId = "123",
            Username = "User1",
        });
        var jwtPlugin = new Kong.Plugin("jwtPlugin", new Kong.PluginArgs
        {
            ConfigJson = @"	{
		""claims_to_verify"": [""exp""]
	}

",
        });
        var consumerJwtConfig = new Kong.ConsumerJwtAuth("consumerJwtConfig", new Kong.ConsumerJwtAuthArgs
        {
            Algorithm = "HS256",
            ConsumerId = myConsumer.Id,
            Key = "my_key",
            RsaPublicKey = "foo",
            Secret = "my_secret",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-kong/sdk/v4/go/kong"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myConsumer, err := kong.NewConsumer(ctx, "myConsumer", &kong.ConsumerArgs{
			CustomId: pulumi.String("123"),
			Username: pulumi.String("User1"),
		})
		if err != nil {
			return err
		}
		_, err = kong.NewPlugin(ctx, "jwtPlugin", &kong.PluginArgs{
			ConfigJson: pulumi.String(fmt.Sprintf("%v%v%v%v", "	{\n", "		\"claims_to_verify\": [\"exp\"]\n", "	}\n", "\n")),
		})
		if err != nil {
			return err
		}
		_, err = kong.NewConsumerJwtAuth(ctx, "consumerJwtConfig", &kong.ConsumerJwtAuthArgs{
			Algorithm:    pulumi.String("HS256"),
			ConsumerId:   myConsumer.ID(),
			Key:          pulumi.String("my_key"),
			RsaPublicKey: pulumi.String("foo"),
			Secret:       pulumi.String("my_secret"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_kong as kong

my_consumer = kong.Consumer("myConsumer",
    custom_id="123",
    username="User1")
jwt_plugin = kong.Plugin("jwtPlugin", config_json="""	{
		"claims_to_verify": ["exp"]
	}

""")
consumer_jwt_config = kong.ConsumerJwtAuth("consumerJwtConfig",
    algorithm="HS256",
    consumer_id=my_consumer.id,
    key="my_key",
    rsa_public_key="foo",
    secret="my_secret")
import * as pulumi from "@pulumi/pulumi";
import * as kong from "@pulumi/kong";

const myConsumer = new kong.Consumer("my_consumer", {
    customId: "123",
    username: "User1",
});
const jwtPlugin = new kong.Plugin("jwt_plugin", {
    configJson: `	{
		"claims_to_verify": ["exp"]
	}
`,
});
const consumerJwtConfig = new kong.ConsumerJwtAuth("consumer_jwt_config", {
    algorithm: "HS256",
    consumerId: myConsumer.id,
    key: "my_key",
    rsaPublicKey: "foo",
    secret: "my_secret",
});

Coming soon!

Create a ConsumerJwtAuth Resource

new ConsumerJwtAuth(name: string, args: ConsumerJwtAuthArgs, opts?: CustomResourceOptions);
@overload
def ConsumerJwtAuth(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    algorithm: Optional[str] = None,
                    consumer_id: Optional[str] = None,
                    key: Optional[str] = None,
                    rsa_public_key: Optional[str] = None,
                    secret: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None)
@overload
def ConsumerJwtAuth(resource_name: str,
                    args: ConsumerJwtAuthArgs,
                    opts: Optional[ResourceOptions] = None)
func NewConsumerJwtAuth(ctx *Context, name string, args ConsumerJwtAuthArgs, opts ...ResourceOption) (*ConsumerJwtAuth, error)
public ConsumerJwtAuth(string name, ConsumerJwtAuthArgs args, CustomResourceOptions? opts = null)
public ConsumerJwtAuth(String name, ConsumerJwtAuthArgs args)
public ConsumerJwtAuth(String name, ConsumerJwtAuthArgs args, CustomResourceOptions options)
type: kong:ConsumerJwtAuth
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ConsumerJwtAuthArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ConsumerJwtAuthArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ConsumerJwtAuthArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ConsumerJwtAuthArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ConsumerJwtAuthArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ConsumerJwtAuth Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ConsumerJwtAuth resource accepts the following input properties:

ConsumerId string

the id of the consumer to be configured with jwt auth

RsaPublicKey string

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

Algorithm string

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

Key string

A unique string identifying the credential. If left out, it will be auto-generated.

Secret string

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

Tags List<string>

A list of strings associated with the consumer JWT auth for grouping and filtering

ConsumerId string

the id of the consumer to be configured with jwt auth

RsaPublicKey string

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

Algorithm string

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

Key string

A unique string identifying the credential. If left out, it will be auto-generated.

Secret string

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

Tags []string

A list of strings associated with the consumer JWT auth for grouping and filtering

consumerId String

the id of the consumer to be configured with jwt auth

rsaPublicKey String

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

algorithm String

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

key String

A unique string identifying the credential. If left out, it will be auto-generated.

secret String

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags List<String>

A list of strings associated with the consumer JWT auth for grouping and filtering

consumerId string

the id of the consumer to be configured with jwt auth

rsaPublicKey string

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

algorithm string

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

key string

A unique string identifying the credential. If left out, it will be auto-generated.

secret string

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags string[]

A list of strings associated with the consumer JWT auth for grouping and filtering

consumer_id str

the id of the consumer to be configured with jwt auth

rsa_public_key str

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

algorithm str

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

key str

A unique string identifying the credential. If left out, it will be auto-generated.

secret str

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags Sequence[str]

A list of strings associated with the consumer JWT auth for grouping and filtering

consumerId String

the id of the consumer to be configured with jwt auth

rsaPublicKey String

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

algorithm String

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

key String

A unique string identifying the credential. If left out, it will be auto-generated.

secret String

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags List<String>

A list of strings associated with the consumer JWT auth for grouping and filtering

Outputs

All input properties are implicitly available as output properties. Additionally, the ConsumerJwtAuth resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing ConsumerJwtAuth Resource

Get an existing ConsumerJwtAuth resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ConsumerJwtAuthState, opts?: CustomResourceOptions): ConsumerJwtAuth
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        algorithm: Optional[str] = None,
        consumer_id: Optional[str] = None,
        key: Optional[str] = None,
        rsa_public_key: Optional[str] = None,
        secret: Optional[str] = None,
        tags: Optional[Sequence[str]] = None) -> ConsumerJwtAuth
func GetConsumerJwtAuth(ctx *Context, name string, id IDInput, state *ConsumerJwtAuthState, opts ...ResourceOption) (*ConsumerJwtAuth, error)
public static ConsumerJwtAuth Get(string name, Input<string> id, ConsumerJwtAuthState? state, CustomResourceOptions? opts = null)
public static ConsumerJwtAuth get(String name, Output<String> id, ConsumerJwtAuthState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Algorithm string

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

ConsumerId string

the id of the consumer to be configured with jwt auth

Key string

A unique string identifying the credential. If left out, it will be auto-generated.

RsaPublicKey string

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

Secret string

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

Tags List<string>

A list of strings associated with the consumer JWT auth for grouping and filtering

Algorithm string

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

ConsumerId string

the id of the consumer to be configured with jwt auth

Key string

A unique string identifying the credential. If left out, it will be auto-generated.

RsaPublicKey string

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

Secret string

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

Tags []string

A list of strings associated with the consumer JWT auth for grouping and filtering

algorithm String

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

consumerId String

the id of the consumer to be configured with jwt auth

key String

A unique string identifying the credential. If left out, it will be auto-generated.

rsaPublicKey String

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

secret String

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags List<String>

A list of strings associated with the consumer JWT auth for grouping and filtering

algorithm string

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

consumerId string

the id of the consumer to be configured with jwt auth

key string

A unique string identifying the credential. If left out, it will be auto-generated.

rsaPublicKey string

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

secret string

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags string[]

A list of strings associated with the consumer JWT auth for grouping and filtering

algorithm str

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

consumer_id str

the id of the consumer to be configured with jwt auth

key str

A unique string identifying the credential. If left out, it will be auto-generated.

rsa_public_key str

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

secret str

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags Sequence[str]

A list of strings associated with the consumer JWT auth for grouping and filtering

algorithm String

The algorithm used to verify the token’s signature. Can be HS256, HS384, HS512, RS256, or ES256, Default is HS256

consumerId String

the id of the consumer to be configured with jwt auth

key String

A unique string identifying the credential. If left out, it will be auto-generated.

rsaPublicKey String

If algorithm is RS256 or ES256, the public key (in PEM format) to use to verify the token’s signature

secret String

If algorithm is HS256 or ES256, the secret used to sign JWTs for this credential. If left out, will be auto-generated

tags List<String>

A list of strings associated with the consumer JWT auth for grouping and filtering

Package Details

Repository
https://github.com/pulumi/pulumi-kong
License
Apache-2.0
Notes

This Pulumi package is based on the kong Terraform Provider.