private ResourceModel UpdateUser(ResourceModel user) { var password = this.Password.ConvertToString(); PasswordUtility.ValidateUserPasswordPattern(nameof(this.Password), password); var encryptedSecret = DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret( this.DeviceName, this.ResourceGroupName, password, this.GetKeyForEncryption() ); user.EncryptedPassword = encryptedSecret; return(this.DataBoxEdgeManagementClient.Users.CreateOrUpdate( this.DeviceName, this.Name, user, this.ResourceGroupName)); }
private PSStackEdgeUser CreateResourceModel() { var password = this.Password.ConvertToString(); PasswordUtility.ValidateUserPasswordPattern(nameof(this.Password), password); var encryptedSecret = StackEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret( this.DeviceName, this.ResourceGroupName, password, this.GetKeyForEncryption() ); var user = new User(GetUserType(), null, Name, encryptedPassword: encryptedSecret); return(new PSStackEdgeUser( this.StackEdgeManagementClient.Users.CreateOrUpdate( this.DeviceName, this.Name, user, this.ResourceGroupName ))); }
private PSResourceModel CreateResourceModel() { var password = this.Password.ConvertToString(); PasswordUtility.ValidateUserPasswordPattern(nameof(this.Password), password); var encryptedSecret = DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret( this.DeviceName, this.ResourceGroupName, password, this.GetKeyForEncryption() ); return(new PSResourceModel( UsersOperationsExtensions.CreateOrUpdate( this.DataBoxEdgeManagementClient.Users, this.DeviceName, this.Name, this.ResourceGroupName, encryptedSecret ))); }