package com.airlock.iam.flow.shared.application.configuration.valueprovider;

import com.airlock.iam.common.application.configuration.event.EventReadyValueMapProviderConfig;
import com.airlock.iam.flow.api.application.configuration.valueprovider.ValueMapProviderConfig;
import com.airlock.iam.plugin.api.annotation.config.Plugin;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@Plugin(
   description = "<p>Provides some data about the successful authentication of the user.</p><p>Currently, the following values are provided:<ul><li><b>auth-token-id</b>: Auth Token ID (available as soon as the user has used a second factor for authentication in this session).</li><li><b>authentication-timestamp</b>: timestamp (as date object) of the successful authentication (available as soon as the user has successfully authenticated for the first time in this session). Can be used by template-based providers to format the timestamp into a specific date format.</li><li><b>authentication-timestamp-millis</b>: timestamp (as number of milliseconds since epoch) of the successful authentication (available as soon as the user has successfully authenticated for the first time in this session).</li></ul></p>",
   displayName = "Authentication Data Map"
)
public final class AuthenticationDataValueMapProviderConfig implements ValueMapProviderConfig, EventReadyValueMapProviderConfig {
   public static final String AUTHENTICATION_DATA_MAP_PROVIDER_DISPLAY_NAME = "Authentication Data Map";
   public static final String AUTH_TOKEN_ID_KEY = "auth-token-id";
   public static final String AUTHENTICATION_TIMESTAMP_KEY = "authentication-timestamp";
   public static final String AUTHENTICATION_TIMESTAMP_EPOCH_KEY = "authentication-timestamp-millis";

   @SuppressFBWarnings(justification = "generated code")
   public static AuthenticationDataValueMapProviderConfig.AuthenticationDataValueMapProviderConfigBuilder builder() {
      return new AuthenticationDataValueMapProviderConfig.AuthenticationDataValueMapProviderConfigBuilder();
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class AuthenticationDataValueMapProviderConfigBuilder {
      @SuppressFBWarnings(justification = "generated code")
      AuthenticationDataValueMapProviderConfigBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public AuthenticationDataValueMapProviderConfig build() {
         return new AuthenticationDataValueMapProviderConfig();
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "AuthenticationDataValueMapProviderConfig.AuthenticationDataValueMapProviderConfigBuilder()";
      }
   }
}
