本文整理汇总了Java中org.pentaho.di.core.auth.NoAuthenticationAuthenticationProvider类的典型用法代码示例。如果您正苦于以下问题:Java NoAuthenticationAuthenticationProvider类的具体用法?Java NoAuthenticationAuthenticationProvider怎么用?Java NoAuthenticationAuthenticationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoAuthenticationAuthenticationProvider类属于org.pentaho.di.core.auth包,在下文中一共展示了NoAuthenticationAuthenticationProvider类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetSupportedPerformers
import org.pentaho.di.core.auth.NoAuthenticationAuthenticationProvider; //导入依赖的package包/类
@SuppressWarnings( "rawtypes" )
@Test
public void testGetSupportedPerformers() throws AuthenticationConsumptionException, AuthenticationFactoryException {
manager.registerConsumerClass( DelegatingNoAuthConsumer.class );
manager.registerConsumerClass( DelegatingUsernamePasswordConsumer.class );
manager.registerConsumerClass( DelegatingKerberosConsumer.class );
UsernamePasswordAuthenticationProvider usernamePasswordAuthenticationProvider =
new UsernamePasswordAuthenticationProvider( "upass", "u", "pass" );
manager.registerAuthenticationProvider( usernamePasswordAuthenticationProvider );
KerberosAuthenticationProvider kerberosAuthenticationProvider =
new KerberosAuthenticationProvider( "kerb", "kerb", true, "pass", true, "none" );
manager.registerAuthenticationProvider( kerberosAuthenticationProvider );
List<AuthenticationPerformer<Object, AuthenticationConsumer>> performers =
manager.getSupportedAuthenticationPerformers( Object.class, AuthenticationConsumer.class );
assertEquals( 3, performers.size() );
Set<String> ids =
new HashSet<String>( Arrays.asList( NoAuthenticationAuthenticationProvider.NO_AUTH_ID,
usernamePasswordAuthenticationProvider.getId(), kerberosAuthenticationProvider.getId() ) );
for ( AuthenticationPerformer<Object, AuthenticationConsumer> performer : performers ) {
ids.remove( performer.getAuthenticationProvider().getId() );
}
assertEquals( 0, ids.size() );
}
示例2: consume
import org.pentaho.di.core.auth.NoAuthenticationAuthenticationProvider; //导入依赖的package包/类
@Override
public HadoopAuthorizationService consume( NoAuthenticationAuthenticationProvider authenticationProvider )
throws AuthenticationConsumptionException {
final Iterator<NoOpHadoopAuthorizationService> providers =
ServiceLoader.load( NoOpHadoopAuthorizationService.class, NoOpHadoopAuthorizationService.class.getClassLoader() )
.iterator();
if ( providers.hasNext() ) {
return providers.next();
}
return new NoOpHadoopAuthorizationService();
}
示例3: testNoAuthProviderAndConsumer
import org.pentaho.di.core.auth.NoAuthenticationAuthenticationProvider; //导入依赖的package包/类
@SuppressWarnings( "unchecked" )
@Test
public void testNoAuthProviderAndConsumer() throws AuthenticationConsumptionException, AuthenticationFactoryException {
manager.registerConsumerClass( DelegatingNoAuthConsumer.class );
AuthenticationConsumer<Object, NoAuthenticationAuthenticationProvider> consumer =
mock( AuthenticationConsumer.class );
manager.getAuthenticationPerformer( Object.class, AuthenticationConsumer.class,
NoAuthenticationAuthenticationProvider.NO_AUTH_ID ).perform( consumer );
verify( consumer ).consume( noAuthenticationAuthenticationProvider );
}
示例4: onLoad
import org.pentaho.di.core.auth.NoAuthenticationAuthenticationProvider; //导入依赖的package包/类
@Override
public void onLoad( HadoopConfiguration config, HadoopConfigurationFileSystemManager fsm ) throws Exception {
AuthenticationConsumerPluginType.getInstance().registerPlugin( (URLClassLoader) getClass().getClassLoader(),
HadoopNoAuthConsumer.HadoopNoAuthConsumerType.class );
String activators = config.getConfigProperties().getProperty( "activator.classes" );
if ( activators != null ) {
activators = activators.trim();
for ( String className : activators.split( "," ) ) {
className = className.trim();
if ( className.length() > 0 ) {
createActivatorInstance( className );
}
}
}
String provider = NoAuthenticationAuthenticationProvider.NO_AUTH_ID;
if ( config.getConfigProperties().containsKey( SUPER_USER ) && !config.getConfigProperties()
.getProperty( MAPPING_IMPERSONATION_TYPE, "" ).trim().equalsIgnoreCase( "disabled" ) ) {
provider = config.getConfigProperties().getProperty( SUPER_USER );
if ( provider.trim().length() == 0 ) {
provider = NoAuthenticationAuthenticationProvider.NO_AUTH_ID;
}
}
AuthenticationManager manager = AuthenticationPersistenceManager.getAuthenticationManager();
new PropertyAuthenticationProviderParser( config.getConfigProperties(), manager ).process( PROVIDER_LIST );
AuthenticationPerformer<HadoopAuthorizationService, Properties> performer =
manager.getAuthenticationPerformer( HadoopAuthorizationService.class, Properties.class, provider );
if ( performer == null ) {
throw new RuntimeException( "Unable to find relevant provider for chosen authentication method (id of "
+ config.getConfigProperties().getProperty( SUPER_USER ) );
} else {
HadoopAuthorizationService hadoopAuthorizationService = performer.perform( config.getConfigProperties() );
if ( hadoopAuthorizationService == null ) {
throw new RuntimeException( "Unable to get HadoopAuthorizationService for provider "
+ config.getConfigProperties().getProperty( SUPER_USER ) );
}
for ( PentahoHadoopShim shim : config.getAvailableShims() ) {
if ( HasHadoopAuthorizationService.class.isInstance( shim ) ) {
( (HasHadoopAuthorizationService) shim ).setHadoopAuthorizationService( hadoopAuthorizationService );
} else {
throw new Exception( "Found shim: " + shim + " that didn't implement "
+ HasHadoopAuthorizationService.class.getCanonicalName() );
}
}
}
super.onLoad( config, fsm );
}
示例5: setup
import org.pentaho.di.core.auth.NoAuthenticationAuthenticationProvider; //导入依赖的package包/类
@Before
public void setup() {
manager = new AuthenticationManager();
noAuthenticationAuthenticationProvider = new NoAuthenticationAuthenticationProvider();
manager.registerAuthenticationProvider( noAuthenticationAuthenticationProvider );
}