use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class OptionsModel method onEdit.
private void onEdit() {
if (getWindow() != null) {
return;
}
final EditOptionsModel model = new EditOptionsModel();
model.setTitle(constants.editOptionsTitle());
// $NON-NLS-1$
model.setHashName("edit_options");
setWindow(model);
UICommand okCommand = UICommand.createDefaultOkUiCommand(constants.ok(), this);
model.getCommands().add(okCommand);
UICommand cancelCommand = UICommand.createCancelUiCommand(constants.cancel(), this);
model.getCommands().add(cancelCommand);
AsyncDataProvider.getInstance().getUserProfile(model.asyncQuery(returnValue -> {
UserProfile profile = returnValue.getReturnValue();
if (profile != null) {
setUserProfile(profile);
model.getPublicKey().setEntity(profile.getSshPublicKey());
}
}));
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class BackendSSHPublicKeysResource method add.
@Override
public Response add(SshPublicKey pubkey) {
validateParameters(pubkey, "content");
UserProfileParameters params = new UserProfileParameters();
UserProfile profile = map(pubkey);
profile.setUserId(userId);
params.setUserProfile(profile);
return performAction(ActionType.AddUserProfile, params);
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class RemoveUserProfileCommand method executeCommand.
@Override
protected void executeCommand() {
UserProfile profile = getUserProfile();
userProfileDao.remove(profile.getId());
setSucceeded(true);
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class VMConsoleProxyServlet method availablePublicKeys.
// TODO: implmement key filtering based on input parameters
private List<Map<String, String>> availablePublicKeys(String keyFingerPrint, String keyType, String keyContent) {
List<Map<String, String>> jsonUsers = new ArrayList<>();
QueryParametersBase userProfileParams = new QueryParametersBase();
QueryReturnValue v = backend.runInternalQuery(QueryType.GetAllUserProfiles, userProfileParams);
if (v != null) {
List<UserProfile> profiles = v.getReturnValue();
for (UserProfile profile : profiles) {
if (StringUtils.isNotEmpty(profile.getSshPublicKey())) {
for (String publicKey : StringUtils.split(profile.getSshPublicKey(), "\n")) {
if (StringUtils.isNotEmpty(publicKey)) {
Map<String, String> jsonUser = new HashMap<>();
jsonUser.put("entityid", profile.getUserId().toString());
jsonUser.put("entity", profile.getLoginName());
jsonUser.put("key", publicKey.trim());
jsonUsers.add(jsonUser);
}
}
}
}
}
return jsonUsers;
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class UserProfileDaoTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
dao = dbFacade.getUserProfileDao();
existingProfile = dao.get(new Guid("38cb5663-96bc-485c-834a-cbbc03acc820"));
deletableProfile = dao.get(new Guid("38cb5663-96bc-485c-834a-cbbc03acc821"));
newProfile = new UserProfile();
newProfile.setId(Guid.newGuid());
newProfile.setUserId(new Guid("81940459-2ec4-4afa-bbaa-22549555293c"));
newProfile.setSshPublicKeyId(new Guid("67bc5484-d4eb-47ce-8b6a-e9624b70b676"));
newProfile.setSshPublicKey("key3");
newProfile.setLoginName("userportal4@testportal.redhat.com@testportal.redhat.com");
// FIXME: this user@domain@domain is ugly, but it is harmless for our test.
}
Aggregations