当前位置: 首页>>代码示例>>Java>>正文


Java PasswordGrantTokenProvider类代码示例

本文整理汇总了Java中org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider的典型用法代码示例。如果您正苦于以下问题:Java PasswordGrantTokenProvider类的具体用法?Java PasswordGrantTokenProvider怎么用?Java PasswordGrantTokenProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PasswordGrantTokenProvider类属于org.cloudfoundry.reactor.tokenprovider包,在下文中一共展示了PasswordGrantTokenProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCloudFoundryOperations

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
private CloudFoundryOperations createCloudFoundryOperations() {
    DefaultConnectionContext connectionContext = DefaultConnectionContext.builder()
        .apiHost(apiHost)
        .build();

    TokenProvider tokenProvider = PasswordGrantTokenProvider.builder()
        .password(password)
        .username(userName)
        .build();

    ReactorCloudFoundryClient reactorClient = ReactorCloudFoundryClient.builder()
        .connectionContext(connectionContext)
        .tokenProvider(tokenProvider)
        .build();

    CloudFoundryOperations cloudFoundryOperations = DefaultCloudFoundryOperations.builder()
        .cloudFoundryClient(reactorClient)
        .organization(organization)
        .space(space)
        .build();

    return cloudFoundryOperations;
}
 
开发者ID:StuPro-TOSCAna,项目名称:TOSCAna,代码行数:24,代码来源:Connection.java

示例2: setup

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Before
public void setup()
{
	String host = System.getenv("CF_HOST");
	String username = System.getenv("CF_USERNAME");
	String password = System.getenv("CF_PASSWORD");

	if(host == null || username == null || password == null)
	{
		throw new RuntimeException("CF_HOST, CF_USERNAME and CF_PASSWORD must be set");
	}

	DefaultConnectionContext connectionContext = DefaultConnectionContext.builder().apiHost(host).skipSslValidation(true).build();
	PasswordGrantTokenProvider tokenProvider = PasswordGrantTokenProvider.builder().username(username).password(password).build();
	cfClient = ReactorCloudFoundryClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
	ModifyingUserOps createUserOps = new ModifyingUserOps(connectionContext, connectionContext.getRoot(), tokenProvider);
	facade = new ReactorCfClientFacade(cfClient, createUserOps);

	String orgName = "converger-test-"+UUID.randomUUID().toString();
	orgId = facade.createOrg(orgName);
}
 
开发者ID:EngineerBetter,项目名称:cf-converger,代码行数:22,代码来源:ReactorCfClientFacadeIntegrationTest.java

示例3: setup

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Before
public void setup()
{
	String host = System.getenv("CF_HOST");
	String username = System.getenv("CF_USERNAME");
	String password = System.getenv("CF_PASSWORD");

	if(host == null || username == null || password == null)
	{
		throw new RuntimeException("CF_HOST, CF_USERNAME and CF_PASSWORD must be set");
	}

	ConnectionContext connectionContext = DefaultConnectionContext.builder().apiHost(host).skipSslValidation(true).build();
	TokenProvider tokenProvider = PasswordGrantTokenProvider.builder().username(username).password(password).build();

	ReactorUaaClient uaaClient = ReactorUaaClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
	uaa = new ReactorUaaClientFacade(uaaClient);
}
 
开发者ID:EngineerBetter,项目名称:cf-converger,代码行数:19,代码来源:ReactorUaaFacadeIntegrationTest.java

示例4: setup

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Before
public void setup()
{
	String host = System.getenv("CF_HOST");
	String username = System.getenv("CF_USERNAME");
	String password = System.getenv("CF_PASSWORD");

	if(host == null || username == null || password == null)
	{
		throw new RuntimeException("CF_HOST, CF_USERNAME and CF_PASSWORD must be set");
	}

	ConnectionContext connectionContext = DefaultConnectionContext.builder().apiHost(host).skipSslValidation(true).build();
	TokenProvider tokenProvider = PasswordGrantTokenProvider.builder().username(username).password(password).build();
	cfClient = ReactorCloudFoundryClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
	cfOps = DefaultCloudFoundryOperations.builder().cloudFoundryClient(cfClient).build();
	facade = new ReactorCfClientFacade(cfClient, mock(ModifyingUserOps.class));
}
 
开发者ID:EngineerBetter,项目名称:cf-converger,代码行数:19,代码来源:ReactorCfClientFacadeOrgsIntegrationTest.java

示例5: getClient

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
private CloudFoundryClient getClient(RepositoryConfiguration repositoryConfiguration) {
    String api = repositoryConfiguration.get("REPO_URL").getValue();
    String username = repositoryConfiguration.get("USERNAME").getValue();
    String password = repositoryConfiguration.get("PASSWORD").getValue();

    LOGGER.debug("Cloud Foundry connection details: api: " + api + ", username " + username);

    ConnectionContext connectionContext = DefaultConnectionContext.builder()
            .apiHost(api)
            .skipSslValidation(true)
            .build();

    ReactorCloudFoundryClient client = ReactorCloudFoundryClient.builder()
            .connectionContext(connectionContext)
            .tokenProvider(PasswordGrantTokenProvider.builder()
                    .username(username)
                    .password(password)
                    .build())
            .build();

    return client;
}
 
开发者ID:Sounie,项目名称:springer-gocd-cloudfoundry-plugin,代码行数:23,代码来源:CloudFoundryPoller.java

示例6: setup

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Before
public void setup() {
    ConnectionContext connectionContext = DefaultConnectionContext.builder()
            .apiHost("api.local.pcfdev.io")
            .skipSslValidation(true)
            .build();

    String username = "user";
    String password = "pass";

    client = ReactorCloudFoundryClient.builder()
            .connectionContext(connectionContext)
            .tokenProvider(PasswordGrantTokenProvider.builder()
                    .password(password)
                    .username(username)
                    .build())
            .build();

    Mono<GetInfoResponse> getInfoResponseMono = client.info().get(GetInfoRequest.builder().build());
    GetInfoResponse response = getInfoResponseMono.block(Duration.ofSeconds(5L));
    String apiVersion = response.getApiVersion();
    assertThat(apiVersion, is(notNullValue()));
    majorApiVersion = Integer.parseInt(apiVersion.split("\\.")[0]);
}
 
开发者ID:Sounie,项目名称:springer-gocd-cloudfoundry-plugin,代码行数:25,代码来源:LocalCfTest.java

示例7: producesAllBeans

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Test
public void producesAllBeans() {

	Assume.assumeTrue(configExists());

	ApplicationContext ctx = new SpringApplicationBuilder()
			.sources(MyConfig.class)
			.properties(defaultConfig())
			.run();

	Class[] tags = {ReactorCloudFoundryClient.class, DefaultCloudFoundryOperations.class,
			DefaultConnectionContext.class, DopplerClient.class, RoutingClient.class, PasswordGrantTokenProvider.class,
			ReactorUaaClient.class};
	for (Class<?> c : tags) {
		Assertions.assertThat(ctx.getBean(c)).isNotNull();
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry,代码行数:18,代码来源:CloudFoundryClientAutoConfigurationTest.java

示例8: tokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Bean
public PasswordGrantTokenProvider tokenProvider(
        @Value("${cf.user}") String username, @Value("${cf.password}") String password) {
    return PasswordGrantTokenProvider
            .builder()
            .password(password)
            .username(username)
            .build();
}
 
开发者ID:applied-continuous-delivery-livelessons,项目名称:testing-101,代码行数:10,代码来源:CloudFoundryClientConfiguration.java

示例9: tokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Bean
PasswordGrantTokenProvider tokenProvider(@Value("${cf.username}") String username,
                                         @Value("${cf.password}") String password) {
    return PasswordGrantTokenProvider.builder()
        .password(password)
        .username(username)
        .build();
}
 
开发者ID:nebhale,项目名称:cf-java-client-webinar-2016,代码行数:9,代码来源:ListApplicationsApplication.java

示例10: tokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Bean
PasswordGrantTokenProvider tokenProvider(@Value("${cf.username}") String username, @Value("${cf.password}") String password) {
	return PasswordGrantTokenProvider.builder()
			.password(password)
			.username(username)
			.build();
}
 
开发者ID:EngineerBetter,项目名称:cf-converger,代码行数:8,代码来源:CfConfig.java

示例11: tokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Bean
PasswordGrantTokenProvider tokenProvider(@Value("${test.username}") String username,
                                         @Value("${test.password}") String password) {

    return PasswordGrantTokenProvider.builder()
            .password(password)
            .username(username)
            .build();
}
 
开发者ID:orange-cloudfoundry,项目名称:sec-group-broker-filter,代码行数:10,代码来源:IntegrationTestConfiguration.java

示例12: tokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Bean
PasswordGrantTokenProvider tokenProvider(CloudFoundryClientSettings cloudFoundryClientSettings) {
    return PasswordGrantTokenProvider.builder()
            .password(cloudFoundryClientSettings.getPassword())
            .username(cloudFoundryClientSettings.getUser())
            .build();
}
 
开发者ID:orange-cloudfoundry,项目名称:sec-group-broker-filter,代码行数:8,代码来源:CloudfoundryClientConfig.java

示例13: getTokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
protected TokenProvider getTokenProvider(CfProperties cfAppProperties) {
    if (cfAppProperties.ccToken() == null &&
        (cfAppProperties.ccUser() == null && cfAppProperties.ccPassword() == null)) {
        throw new IllegalStateException("One of token or user/password should be provided");
    }

    if (cfAppProperties.ccToken() != null) {
        return new StaticTokenProvider(cfAppProperties.ccToken());
    } else {
        return PasswordGrantTokenProvider.builder()
            .password(cfAppProperties.ccPassword())
            .username(cfAppProperties.ccUser())
            .build();
    }
}
 
开发者ID:pivotalservices,项目名称:ya-cf-app-gradle-plugin,代码行数:16,代码来源:AbstractCfTask.java

示例14: getAppDetailTests

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Test
    public void getAppDetailTests() {
        ConnectionContext connectionContext = DefaultConnectionContext.builder()
            .apiHost("api.local.pcfdev.io")
            .skipSslValidation(true)
            .build();

        TokenProvider tokenProvider = PasswordGrantTokenProvider.builder()
            .password("admin")
            .username("admin")
            .build();

        CloudFoundryClient cfClient = ReactorCloudFoundryClient.builder()
            .connectionContext(connectionContext)
            .tokenProvider(tokenProvider)
            .build();

        CloudFoundryOperations cfOperations = DefaultCloudFoundryOperations.builder()
            .cloudFoundryClient(cfClient)
            .organization("pcfdev-org")
            .space("pcfdev-space")
            .build();

        CfAppDetailsDelegate appDetailsTaskDelegate = new CfAppDetailsDelegate();
        CfProperties cfAppProps = envDetails();
        Mono<Optional<ApplicationDetail>> applicationDetailMono = appDetailsTaskDelegate
            .getAppDetails(cfOperations, cfAppProps);


//		Mono<Void> resp = applicationDetailMono.then(applicationDetail -> Mono.fromSupplier(() -> {
//			return 1;
//		})).then();
//
//		resp.block();
//		ApplicationDetail applicationDetail = applicationDetailMono.block(Duration.ofMillis(5000));
//		System.out.println("applicationDetail = " + applicationDetail);
    }
 
开发者ID:pivotalservices,项目名称:ya-cf-app-gradle-plugin,代码行数:38,代码来源:PcfDevIntegrationTests.java

示例15: tokenProvider

import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public TokenProvider tokenProvider(CloudFoundryConnectionProperties properties) {
	return PasswordGrantTokenProvider.builder()
		.username(properties.getUsername())
		.password(properties.getPassword())
		.build();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:9,代码来源:CloudFoundryDeployerAutoConfiguration.java


注:本文中的org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。