testcontainers-spring-boot icon indicating copy to clipboard operation
testcontainers-spring-boot copied to clipboard

Support Grafana "Anonymous Auth" option.

Open emrygun opened this issue 2 years ago • 1 comments

Users may want to deploy simple monitoring services without any authorization/authentication settings.
So, "Anonymous Auth" option with it's "Anonymous Organization Role" settings would be a useful and fast solution for that.

The GF_AUTH_ANONYMOUS_ENABLED and GF_AUTH_ANONYMOUS_ORG_ROLE container environment variables stands for them.

For the clarification of feature request, I'll share a rough code snippet for desired scenario.

        GenericContainer<?> container =
                new GenericContainer<>(ContainerUtils.getDockerImageName(properties))
                        .withEnv("GF_SECURITY_ADMIN_USER", properties.getUsername())
                        .withEnv("GF_SECURITY_ADMIN_PASSWORD", properties.getPassword())
                        //TODO: Anonymous Auth Configuration
                        .withEnv("GF_AUTH_ANONYMOUS_ENABLED", properties.getAnonymousAuthEnabled())
                        .withEnv("GF_AUTH_ANONYMOUS_ORG_ROLE", properties.getAnonymousOrgRole())
                        .withNetwork(Network.SHARED)
                        .withNetworkAliases(properties.getNetworkAlias(), GRAFANA_NETWORK_ALIAS)
                        .waitingFor(grafanaWaitStrategy);

emrygun avatar Oct 09 '23 18:10 emrygun

Pull request welcome ;)

Fameing avatar Oct 13 '23 10:10 Fameing