org.tkit.quarkus.rs.context.tenant.RestContextTenantIdConfig Maven / Gradle / Ivy
package org.tkit.quarkus.rs.context.tenant;
import java.util.Map;
import io.quarkus.runtime.annotations.StaticInitSafe;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
@StaticInitSafe
@ConfigMapping(prefix = "tkit.rs.context.tenant-id")
public interface RestContextTenantIdConfig {
@WithName("enabled")
@WithDefault("false")
boolean enabled();
@WithName("default")
@WithDefault("default")
String defaultTenantId();
@WithName("header-param-enabled")
@WithDefault("false")
boolean headerParamEnabled();
@WithName("header-param-name")
@WithDefault("tenant-id")
String headerParamName();
@WithName("mock")
MockConfig mock();
@WithName("token")
TokenConfig token();
interface TokenConfig {
/**
* Enable or disable tenant token claim.
*/
@WithName("enabled")
@WithDefault("false")
boolean enabled();
/**
* Default mock tenant
*/
@WithName("claim-tenant-param")
@WithDefault("tenantId")
String claimTenantParam();
}
interface MockConfig {
/**
* Enable or disable tenant mock service.
*/
@WithName("enabled")
@WithDefault("false")
boolean enabled();
/**
* Default mock tenant
*/
@WithName("default-tenant")
@WithDefault("default")
String defaultTenant();
/**
* Mock data
*/
@WithName("data")
Map data();
/**
* Token organization claim id
*/
@WithName("claim-org-id")
@WithDefault("orgId")
String claimOrgId();
}
}