Go Plugins default values

Hi everyone,
I developed a Go plugin, and added some default values for the plugin config, however, these values do not appear to reflect on the config on Kong Manager. Is it possible to set the default values and have it reflected in the Kong API?

Here is my setup:

type AzureAuthConfig struct {
	TenantId        string `json:"tenant_id"`
	ClientId        string `json:"client_id"`
	JWTContextKey   string `json:"jwt_context_key"`
	DisableJWTCache bool   `json:"disable_jwt_cache"`

func New() interface{} {
	return &AzureAuthConfig{DisableJWTCache: true, JWTContextKey: "rawJWT"}

Hi there - this looks like a feature request. It doesn’t appear there is a way to set defaults in the schema for go plugins (but you can do so in the code). I’ll make a note of this. It is supported in Lua plugins today and the defaults do show up in Kong Manager.

1 Like