numerus/deploy
jordi fita mas ea9e830a75 Add user_profile view to update the profile with form
Since users do not have access to the auth scheme, i had to add a view
that selects only the data that they can see of themselves (i.e., no
password or cookie).

I wanted to use the `request.user.id` setting that i set in
check_cookie, but this would be bad because anyone can change that
parameter and, since the view is created by the owner, could see and
*change* the values of everyone just by knowing their id.  Thus, now i
use the cookie instead, because it is way harder to figure out, and if
you already have it you can just set to your browser and the user is
fucked anyway; the database can not help here.

I **am** going to use the user id in row level security policies, but
not the value coming for the setting but instaed the one in the
`user_profile`, since it already is “derived” from the cookie, that’s
why i added that column to the view.

The profile includes the language, that i do not use it yet to switch
the locale, so i had to add a relation of the available languages, for
constraint purposes.  There is no NULL language, and instead i added the
“Undefined” language, with ‘und’ tag’, to represent “do not know/use
content negotiation”.

The languages in that relation are the same i used to have inside
locale.go, because there is no point on having options for languages i
do not have the translation for, so i now configure the list of
available languages user in content negotiation from that relation.

Finally, i have added all font from RemixIcon because that’s what we
used in the design and i am going to use quite a lot of them.

There is duplication in the views; i will address that in a different
commit.
2023-01-22 02:23:09 +01:00
..
available_languages.sql Add user_profile view to update the profile with form 2023-01-22 02:23:09 +01:00
check_cookie.sql Add user_profile view to update the profile with form 2023-01-22 02:23:09 +01:00
current_app_user.sql Add user_profile view to update the profile with form 2023-01-22 02:23:09 +01:00
email.sql Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
encrypt_password.sql Remove the revocation of all function executions 2023-01-17 13:05:58 +01:00
ensure_role_exists.sql Remove the revocation of all function executions 2023-01-17 13:05:58 +01:00
extension_citext.sql Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
extension_pgcrypto.sql Create pgcrypto extension into auth schema 2023-01-17 13:12:18 +01:00
language.sql Add user_profile view to update the profile with form 2023-01-22 02:23:09 +01:00
login.sql Implement login cookie, its verification, and logout 2023-01-17 20:58:13 +01:00
login_attempt.sql Implement login cookie, its verification, and logout 2023-01-17 20:58:13 +01:00
logout.sql Add a function to set request settings and the role 2023-01-19 13:07:32 +01:00
roles.sql Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
schema_auth.sql Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
schema_numerus.sql Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
schema_public.sql Move check_cookie to public and give access to authenticator 2023-01-18 14:12:59 +01:00
set_cookie.sql Add a function to set request settings and the role 2023-01-19 13:07:32 +01:00
user.sql Add user_profile view to update the profile with form 2023-01-22 02:23:09 +01:00
user_profile.sql Add user_profile view to update the profile with form 2023-01-22 02:23:09 +01:00