By default, config/initializers/filter_parameter_logging.rb will filter the password
Rails.application.config.filter_parameters += [:password]
So, the logs would filter out the password and never be displayed in the logs. Whenever communicating with API, especially sending the password, you should always encrypt the communication with SSL. This is really no different than sending a POST request to a web login session. Unless the form is posted to an endpoint over SSL, the password would also be sent over plaintext.
Great questions!
If your application's traffic is not being served over SSL, anything that is sent or posted, would be essentially in plain text. It was just illustrating the point that your worry about the API sending the plain text password would be the same worry for a login form. Unless the API endpoint as well as the login form are served over SSL, the password would have been sent over plaintext (and not encrypted via SSL). I suppose the confusion was plaintext. Technically, regardless, in both instances the password is sent as plaintext, but when served over an SSL connection, the plaintext password is protected.
With a user registration, it would function very similar to any other kind of form post that you would do. You should have some sort of registration endpoint within your API application that would create the user. You may have something like http://example.com/users/create where you would make an HTTP POST to via your app. You would pass in the parameters
{
user: {
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
password: '123456',
password_confirmation: '123456'
}
}and your model would have the necessary validations to ensure password complexity, and email uniqueness. If the user is created, pass a successful response. Otherwise, you would respond with an error.
You would also need to provide an authenticate method for your user. In this example, we simply used devise to handle the user registration and authentication. While you could do something similar in an API only application, it might be a bit heavy. However, using the devise logic (not necessarily the views), will give you access to a lot of the built in functionality around locking out the user, confirmation signups, etc.
Depending on the architecture of your application, you can make the new user registration only available under the client portal. Also, if you are using some sort of role based authorization, make sure that you set the default access to a client role.
Hope this helps!
Only if your cache key included the updated_at attribute or similar. Part of the issue is also when you have a collection of records as you might find in Russian Doll Caching. Even if the individual record's cache is expired, you will still need to expire the outer cache (parent cache) as well since it is stale at this point.
It is a Chrome Extension called Advanced REST Client.