本文整理汇总了Java中com.hp.autonomy.hod.client.api.authentication.EntityType.Developer方法的典型用法代码示例。如果您正苦于以下问题:Java EntityType.Developer方法的具体用法?Java EntityType.Developer怎么用?Java EntityType.Developer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.autonomy.hod.client.api.authentication.EntityType
的用法示例。
在下文中一共展示了EntityType.Developer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAuthentication
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Test
public void addAuthentication() throws HodErrorException {
final ApiKey newApiKey = developerService.addAuthentication(getDeveloperToken(), getDeveloperUuid());
assertThat(newApiKey, not(nullValue()));
// Check we can authenticate with the new API key
final AuthenticationService authenticationService = new AuthenticationServiceImpl(getConfig());
final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token = authenticationService.authenticateDeveloper(
newApiKey,
getTenantUuid(),
getEndpoint().getDeveloperEmail()
);
assertThat(token, not(nullValue()));
}
示例2: multipleTokenTypes
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Test
public void multipleTokenTypes() throws IOException {
final AuthenticationToken<EntityType.Combined, TokenType.Simple> combinedToken = new AuthenticationToken<>(
EntityType.Combined.INSTANCE,
TokenType.Simple.INSTANCE,
getExpiry(),
"combined-id",
"combined-secret",
getRefresh()
);
final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> developerToken = new AuthenticationToken<>(
EntityType.Developer.INSTANCE,
TokenType.HmacSha1.INSTANCE,
getExpiry(),
"developer-id",
"developer-secret",
getRefresh()
);
final TokenProxy<EntityType.Combined, TokenType.Simple> combinedTokenProxy = tokenRepository.insert(combinedToken);
final TokenProxy<EntityType.Developer, TokenType.HmacSha1> developerTokenProxy = tokenRepository.insert(developerToken);
final AuthenticationToken<EntityType.Combined, TokenType.Simple> outputCombinedToken = tokenRepository.get(combinedTokenProxy);
final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> outputDeveloperToken = tokenRepository.get(developerTokenProxy);
assertThat(outputDeveloperToken, is(developerToken));
assertThat(outputCombinedToken, is(combinedToken));
}
示例3: addAuthentication
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public ApiKey addAuthentication(final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, final UUID developerUuid) throws HodErrorException {
final String mode = UserAuthMode.API_KEY.getName();
final Request<String, String> request = new Request<>(
Request.Verb.POST,
"/2/developer/" + developerUuid + "/authentication",
null,
Collections.singletonMap(DeveloperBackend.AUTH_MODE_PART, Collections.singletonList(mode))
);
final String signature = hmac.generateToken(request, token);
final AddDeveloperAuthenticationResponse response = backend.addAuthentication(signature, developerUuid, mode);
return response.getCredentials().getApiKey();
}
示例4: create
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public void create(final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, final String domain, final String name, final String description) throws HodErrorException {
final Map<String, List<String>> body = new LinkedHashMap<>();
body.put("application_name", Collections.singletonList(name));
body.put("description", Collections.singletonList(description));
final Request<Void, String> request = new Request<>(Request.Verb.POST, pathForDomain(domain) + "/v1", null, body);
final String signature = hmac.generateToken(request, token);
backend.create(signature, domain, name, description);
}
示例5: update
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public void update(
final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token,
final String domain,
final String name,
final ApplicationUpdateRequest updateRequest
) throws HodErrorException {
final Optional<List<String>> optionalAuthModes = updateRequest.getAuthentications()
.map(authentications -> authentications.stream()
.map(this::serializeAuthentication)
.collect(Collectors.toList())
);
final Map<String, List<String>> body = new HashMap<>();
final Map<String, String> bodyMultiMap = new MultiMap<>();
optionalAuthModes.ifPresent(authenticationStrings -> {
body.put(AUTH_MODES_PART, authenticationStrings);
authenticationStrings.forEach(s -> bodyMultiMap.put(AUTH_MODES_PART, s));
});
updateRequest.getDescription()
.ifPresent(description -> {
body.put(DESCRIPTION_PART, Collections.singletonList(description));
bodyMultiMap.put(DESCRIPTION_PART, description);
});
final Request<Void, String> request = new Request<>(Request.Verb.PATCH, pathForApplication(domain, name) + "/v1", null, body);
final String signature = hmac.generateToken(request, token);
backend.update(signature, domain, name, bodyMultiMap);
}
示例6: list
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public List<Application> list(final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, final String domain) throws HodErrorException {
final Request<Void, Void> request = new Request<>(Request.Verb.GET, pathForDomain(domain) + "/v1", null, null);
final String signature = hmac.generateToken(request, token);
return backend.list(signature, domain).getApplications();
}
示例7: delete
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public void delete(final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, final String domain, final String name) throws HodErrorException {
final Request<Void, Void> request = new Request<>(Request.Verb.DELETE, pathForApplication(domain, name) + "/v1", null, null);
final String signature = hmac.generateToken(request, token);
backend.delete(signature, domain, name);
}
示例8: listAuthentications
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public List<AuthenticationDetails> listAuthentications(final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, final String domain, final String name) throws HodErrorException {
final Request<Void, Void> request = new Request<>(Request.Verb.GET, pathForApplication(domain, name) + "/authentication/v1", null, null);
final String signature = hmac.generateToken(request, token);
return backend.listAuthentications(signature, domain, name).getAuthentications();
}
示例9: addAuthentication
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
@Override
public ApiKey addAuthentication(final AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, final String domain, final String name) throws HodErrorException {
final Request<Void, Void> request = new Request<>(Request.Verb.POST, pathForApplication(domain, name) + "/authentication/v1", null, null);
final String signature = hmac.generateToken(request, token);
return backend.addAuthentication(signature, domain, name).getCredentials().getApplicationApiKey();
}
示例10: getDeveloperToken
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
protected AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> getDeveloperToken() {
return developerToken;
}
示例11: list
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
/**
* List applications in the given domain.
* @param token The developer token
* @param domain The domain name
* @return Applications and their privileges
* @throws HodErrorException
*/
List<Application> list(AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, String domain) throws HodErrorException;
示例12: create
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
/**
* Create an application in the given domain.
* @param token The developer token to use for authentication
* @param domain The domain in which to create the application
* @param name The name of the new application
* @param description The description of the new application
* @throws HodErrorException
*/
void create(AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, String domain, String name, String description) throws HodErrorException;
示例13: delete
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
/**
* Delete an application from a domain.
* @param token The developer token to use for authentication
* @param domain The domain of the application
* @param name The name of the application
* @throws HodErrorException
*/
void delete(AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, String domain, String name) throws HodErrorException;
示例14: update
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
/**
* Update an application's description or authentications.
* @param token The developer token to use for authentication
* @param domain The domain of the application to update
* @param name The name of the application to update
* @param request The update request
* @throws HodErrorException
*/
void update(AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, String domain, String name, ApplicationUpdateRequest request) throws HodErrorException;
示例15: listAuthentications
import com.hp.autonomy.hod.client.api.authentication.EntityType; //导入方法依赖的package包/类
/**
* List the authentications associated with the given application.
* @param token The developer token to use for authentication
* @param domain The domain of the application
* @param name The name of the application
* @return The authentications associated with the application
* @throws HodErrorException
*/
List<AuthenticationDetails> listAuthentications(AuthenticationToken<EntityType.Developer, TokenType.HmacSha1> token, String domain, String name) throws HodErrorException;