本文整理汇总了Java中com.hp.autonomy.hod.client.api.resource.Resource类的典型用法代码示例。如果您正苦于以下问题:Java Resource类的具体用法?Java Resource怎么用?Java Resource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Resource类属于com.hp.autonomy.hod.client.api.resource包,在下文中一共展示了Resource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializesFromUserTokenInformationJson
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
@Test
public void deserializesFromUserTokenInformationJson() throws IOException {
final TextIndexStatus output;
try (final InputStream jsonStream = getClass().getResourceAsStream("/com/hp/autonomy/hod/client/api/textindex/status/text-index-status.json")) {
output = objectMapper.readValue(jsonStream, TextIndexStatus.class);
}
final Resource expectedUserStore = Resource.builder()
.name("DEFAULT_USER_STORE")
.domain("21259eb0-b1c4-4bd7-b4fc-c502aac60a44")
.uuid(UUID.fromString("39b69aed-bdf4-44dc-83a6-aeb41bd7a9af"))
.build();
final TextIndexStatus expectedOutput = TextIndexStatus.builder()
.totalDocuments(5)
.totalIndexSize(15514038)
.componentCount(1)
.flavor(IndexFlavor.STANDARD)
.indexUpdates24hr(5)
.userStore(expectedUserStore)
.build();
assertThat(output, is(expectedOutput));
}
示例2: HodAuthenticationPrincipal
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
public HodAuthenticationPrincipal(
final UUID tenantUuid,
final UUID userUuid,
final ResourceName application,
final Resource userStoreInformation,
final AuthenticationInformation applicationAuthentication,
final AuthenticationInformation userAuthentication,
final String name,
final Map<String, Serializable> userMetadata,
final String securityInfo
) {
this.tenantUuid = tenantUuid;
this.userUuid = userUuid;
this.application = application;
this.userStoreInformation = userStoreInformation;
this.applicationAuthentication = applicationAuthentication;
this.userAuthentication = userAuthentication;
this.name = StringUtils.defaultString(name);
this.securityInfo = securityInfo;
this.userMetadata = userMetadata == null ? new HashMap<>() : userMetadata;
}
示例3: UserTokenInformation
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
public UserTokenInformation(
@JsonProperty("tenant_uuid") final UUID tenantUuid,
@JsonProperty("user_store") final Resource userStore,
@JsonProperty("user") final UserInformation user
) {
this.tenantUuid = tenantUuid;
this.userStore = userStore;
this.user = user;
}
示例4: CombinedTokenInformation
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
public CombinedTokenInformation(
@JsonProperty("tenant_uuid") final UUID tenantUuid,
@JsonProperty("application") final ApplicationInformation application,
@JsonProperty("user_store") final Resource userStore,
@JsonProperty("user") final UserInformation user
) {
this.tenantUuid = tenantUuid;
this.application = application;
this.userStore = userStore;
this.user = user;
}
示例5: GroupInformation
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
public GroupInformation(
@JsonProperty("user_store") final Resource userStore,
@JsonProperty("groups") final Set<String> groups
) {
this.userStore = userStore;
this.groups = new LinkedHashSet<>(groups);
}
示例6: mockCombinedTokenInformation
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
private CombinedTokenInformation mockCombinedTokenInformation() {
final AuthenticationInformation applicationAuthenticationInformation = new AuthenticationInformation(UUID.randomUUID(), AuthenticationType.LEGACY_API_KEY);
final AuthenticationInformation userAuthenticationInformation = new AuthenticationInformation(UUID.randomUUID(), AuthenticationType.LEGACY_API_KEY);
final ApplicationInformation applicationInformation = new ApplicationInformation(APPLICATION_NAME, APPLICATION_DOMAIN, applicationAuthenticationInformation);
final Resource userStore = Resource.builder().uuid(UUID.randomUUID()).name(USERSTORE_NAME).domain(USERSTORE_DOMAIN).build();
final Account account = new Account(Account.Type.EMAIL, "[email protected]", Account.Status.CONFIRMED, true);
final Resource groupUserStore = Resource.builder().uuid(UUID.randomUUID()).name(USERSTORE_NAME).domain(USERSTORE_DOMAIN).build();
final GroupInformation groupInformation = new GroupInformation(groupUserStore, Collections.singleton("ceo"));
final UserInformation userInformation = new UserInformation(USER_UUID, userAuthenticationInformation, Collections.singletonList(account), Collections.singletonList(groupInformation));
return new CombinedTokenInformation(UUID.randomUUID(), applicationInformation, userStore, userInformation);
}
示例7: redirectsWithAuthentication
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
@Test
public void redirectsWithAuthentication() throws IOException, ServletException {
final HttpServletRequest request = mock(HttpServletRequest.class);
when(request.getContextPath()).thenReturn(CONTEXT_PATH);
final String mockRedirectUrl = "/mock/redirect/url";
final HttpServletResponse response = mock(HttpServletResponse.class);
final String expectedPath = CONTEXT_PATH + REDIRECT_PATH + "?token=CMB%3ASIMPLE%3Atoken-id%3Atoken-secret";
when(response.encodeRedirectURL(expectedPath)).thenReturn(mockRedirectUrl);
final HodAuthenticationPrincipal principal = new HodAuthenticationPrincipal(
UUID.randomUUID(),
UUID.randomUUID(),
new ResourceName("APP-DOMAIN", "APP-NAME"),
Resource.builder().uuid(UUID.randomUUID()).domain("STORE-DOMAIN").name("STORE-NAME").build(),
new AuthenticationInformation(UUID.randomUUID(), AuthenticationType.LEGACY_API_KEY),
new AuthenticationInformation(UUID.randomUUID(), AuthenticationType.LEGACY_API_KEY),
null,
null,
null
);
final Authentication authentication = new HodAuthentication<>(
tokenProxy,
Collections.emptySet(),
principal
);
logoutSuccessHandler.onLogoutSuccess(request, response, authentication);
verify(response).sendRedirect(mockRedirectUrl);
}
示例8: createCombinedTokenInformation
import com.hp.autonomy.hod.client.api.resource.Resource; //导入依赖的package包/类
private CombinedTokenInformation createCombinedTokenInformation(final UUID applicationAuthenticationUuid) {
final AuthenticationInformation applicationAuthenticationInformation = new AuthenticationInformation(applicationAuthenticationUuid, AuthenticationType.LEGACY_API_KEY);
final AuthenticationInformation userAuthenticationInformation = new AuthenticationInformation(UUID.randomUUID(), AuthenticationType.LEGACY_API_KEY);
final ApplicationInformation applicationInformation = new ApplicationInformation(APPLICATION_NAME, APPLICATION_DOMAIN, applicationAuthenticationInformation);
final Resource userStore = Resource.builder().uuid(UUID.randomUUID()).name("user_store_name").domain("user_store_domain").build();
final Account account = new Account(Account.Type.EMAIL, "[email protected]", Account.Status.CONFIRMED, true);
final Resource groupUserStore = Resource.builder().uuid(UUID.randomUUID()).name("user_store_name").domain("user_store_domain").build();
final GroupInformation groupInformation = new GroupInformation(groupUserStore, Collections.singleton("ceo"));
final UserInformation userInformation = new UserInformation(USER_UUID, userAuthenticationInformation, Collections.singletonList(account), Collections.singletonList(groupInformation));
return new CombinedTokenInformation(UUID.randomUUID(), applicationInformation, userStore, userInformation);
}
开发者ID:hpe-idol,项目名称:java-hod-sso-spring-security,代码行数:14,代码来源:CookieHodAuthenticationProviderTest.java