public static AuthHandler getAuth ( Vertx vertx , Router router , VertxEngineConfig apimanConfig ) { String type = apimanConfig . getAuth ( ) . getString ( "type" , "NONE" ) ; JsonObject authConfig = apimanConfig . getAuth ( ) . getJsonObject ( "config" , new JsonObject ( ) ) ; switch ( AuthType . getType ( type ) ) { case BASIC : return BasicAuth . create ( authConfig ) ; case NONE : return NoneAuth . create ( ) ; case KEYCLOAK : return KeycloakOAuthFactory . create ( vertx , router , apimanConfig , authConfig ) ; default : return NoneAuth . create ( ) ; } }
Creates an auth handler of the type indicated in the auth section of config .