Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google authentication #24

Merged
merged 98 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
0f20ef9
add configuration to use elixir_auth_google, #247
SimonLab Nov 19, 2019
67b3afd
add elixir_auth_google to application, #247
SimonLab Nov 20, 2019
39d6a73
update mix dependencies, https://github.com/dwyl/app/issues/247
SimonLab Nov 21, 2019
0e56d9d
update travis configuration to user elixir 1.9, https://github.com/dw…
SimonLab Nov 21, 2019
93dae3b
create sessions table, #247
SimonLab Nov 26, 2019
f2a9560
add schema for session, #247
SimonLab Nov 26, 2019
f8bb841
remove key_id from people, #247
SimonLab Nov 27, 2019
d0e937c
create new people on authentication, #247
SimonLab Nov 27, 2019
2501c05
add association people sessions, #247
SimonLab Nov 27, 2019
a4ac4f6
test inserted encrypted token in session table, #247
SimonLab Nov 27, 2019
9e1bf7d
use binary type to save tokens in Postgres, #247
SimonLab Nov 28, 2019
d0d7d8d
use published (alpha) version of elixir_auth_google in mix.exs
nelsonic Nov 29, 2019
9fbfc44
use published version 0.1.8 of fields from hex.pm
nelsonic Nov 29, 2019
b263c29
use :fields v2.0.0 (published hex.pm package) in mix.exs
nelsonic Nov 29, 2019
8b0cf3a
add Blue Sign-in With Google Button fixes #249
nelsonic Nov 30, 2019
eee6a81
add .dwyl-teal and .dwyl-bg-teal to app.css for #247 UI
nelsonic Nov 30, 2019
76b6da0
comment out "workflow" buttons (for now)
nelsonic Nov 30, 2019
6a55b12
rename Google Auth route from /google-auth-callback to /google/auth/c…
nelsonic Nov 30, 2019
ba50a84
update test assertion copy to just "effectiveness" in light of copy c…
nelsonic Nov 30, 2019
4744edb
add favicons to main template https://github.com/dwyl/app/issues/125
nelsonic Nov 30, 2019
462a139
create AppWeb.GoogleAuthControllerTest to test auth helper functions …
nelsonic Nov 30, 2019
4b00297
fix typo in mix.exs
nelsonic Nov 30, 2019
f396832
add initial implementation of transform_profile_data_to_person/1 for …
nelsonic Nov 30, 2019
6ee71e5
derp! fix typo in transform_profile_data_to_person/1 proflie > profil…
nelsonic Nov 30, 2019
0845898
remove Map.get(profile, "email") in favour of profile["email"] #247
nelsonic Nov 30, 2019
315227a
FFS! fix typo in transform_profile_data_to_person/1
nelsonic Nov 30, 2019
046ec91
update version of Erlang to 22.0 in elixir_buildpack.config to match …
nelsonic Nov 30, 2019
32ed44c
add "picture" to transform_profile_data_to_person/1 for #247 https://…
nelsonic Nov 30, 2019
2763753
create migration to add locale and picture to people schema https://g…
nelsonic Nov 30, 2019
d5210d2
fix broken tests #247
nelsonic Nov 30, 2019
96b42b0
add picture, locale givenName, familyName status to people table http…
nelsonic Nov 30, 2019
0df8f00
re-enable sessions in google_auth_controller.ex
nelsonic Nov 30, 2019
fb167b6
update field type of person.email to Fields.EmailEncrypted and update…
nelsonic Nov 30, 2019
3193b97
update version of Fields dep to 2.0.1 to ensure hashing uses SECRET_K…
nelsonic Nov 30, 2019
86d8fab
restore previously known (working/tests passing) state ahead of attem…
nelsonic Dec 1, 2019
cf2f60a
comment out all session pre-loading code https://github.com/dwyl/app/…
nelsonic Dec 1, 2019
9c16aca
update version of Fields to 2.1.0 adds Name field
nelsonic Dec 1, 2019
053d135
setup "welcome" template for Google Auth #247
nelsonic Dec 1, 2019
482ce15
simplify google_auth view & template
nelsonic Dec 1, 2019
02703b1
add person["picture"] to welcome template ... needs styling ... #247
nelsonic Dec 1, 2019
bddf885
display "Welcome {person.name}!" once authenticated #247
nelsonic Dec 2, 2019
5288457
Merge branch 'master' into google-authentication-#247
nelsonic Dec 2, 2019
b8ad2a0
Merge branch 'master' into google-authentication-#247
nelsonic Dec 2, 2019
5e66418
fix typo in mix.exs
nelsonic Dec 2, 2019
3a77332
update version of elixir-auth-google package to 0.1.0 (hard code redi…
nelsonic Dec 2, 2019
5a9a0fd
update ElixirAuthGoogle function invocations to pass in Plug.conn #247
nelsonic Dec 2, 2019
fa855e6
fix typo in url /google/auth/callback should be /auth/google/callback…
nelsonic Dec 2, 2019
1901157
add auth controller, #252
SimonLab Dec 3, 2019
09bb4d6
rename auth controller, #252
SimonLab Dec 3, 2019
08c8b3b
remove auth controller, to be added on a seperate PR, #252
SimonLab Dec 3, 2019
17fc58f
add auth controller, #252
SimonLab Dec 3, 2019
30163cf
merge google-authentication branch
SimonLab Dec 3, 2019
3c90279
add auth as plug to restricted endpoint, #252
SimonLab Dec 3, 2019
52b78b3
assign person id to session, #252
SimonLab Dec 3, 2019
2702d30
test google_auth controller, #252
SimonLab Dec 3, 2019
1b4550c
update test for restricted endpoints, #252
SimonLab Dec 3, 2019
027bc20
update tests to use EmailHash field, #29
SimonLab Dec 3, 2019
3e7e9f9
update get_by_email to search on the emailHash, #29
SimonLab Dec 3, 2019
8e4640a
Merge pull request #30 from dwyl/person-session-#252
nelsonic Dec 3, 2019
198fc40
Merge pull request #31 from dwyl/has-email-#29
nelsonic Dec 3, 2019
2252503
compare email_hash
SimonLab Dec 3, 2019
2901afe
Merge branch 'google-authentication-#247' into avoid-peson-duplicate-#29
SimonLab Dec 3, 2019
01fb000
Merge pull request #32 from dwyl/person-session-#252
SimonLab Dec 3, 2019
0b7ad81
Merge branch 'google-authentication-#247' into avoid-peson-duplicate-#29
SimonLab Dec 4, 2019
4a7f135
parse email attribute, #29
SimonLab Dec 4, 2019
6e68240
define put_email_hash function, #29
SimonLab Dec 4, 2019
96198e9
access person data with ., #29
SimonLab Dec 4, 2019
bb81c1a
Merge pull request #33 from dwyl/avoid-peson-duplicate-#29
nelsonic Dec 4, 2019
2c7565e
redirect to user info page when loggedin, #34
SimonLab Dec 4, 2019
e4d865d
update test for info person, #34
SimonLab Dec 4, 2019
1dbfd08
Merge pull request #36 from dwyl/user-info-#34
nelsonic Dec 4, 2019
8be04f1
use Fields custom type, #25
SimonLab Dec 4, 2019
356b856
Merge branch 'google-authentication-#247' into update-field-types-#25
SimonLab Dec 4, 2019
6f32e0d
Merge pull request #37 from dwyl/update-field-types-#25
nelsonic Dec 4, 2019
de44e63
add seed data for status, #247
SimonLab Dec 4, 2019
ea86da3
set status verified to person on google authentication, #247
SimonLab Dec 4, 2019
21bd695
run seed migration before test, #247
SimonLab Dec 4, 2019
7d5eaab
update ctx test for status, #247
SimonLab Dec 4, 2019
ccde1f2
add back create_status fct, #247
SimonLab Dec 4, 2019
4c96ce3
Merge pull request #38 from dwyl/google-email-status-#247
nelsonic Dec 4, 2019
95b7877
DRY out GoogleAuthController code see: https://github.com/dwyl/app/is…
nelsonic Dec 4, 2019
338abae
update dependency for elixir_auth_google, #258
SimonLab Dec 6, 2019
7a4e065
update test to match new map structure of profile, #258
SimonLab Dec 6, 2019
b0eee0e
update get_user_profile to use atom syntax in map https://github.com/…
nelsonic Dec 6, 2019
9937954
update profile map to use atoms, #258
SimonLab Dec 6, 2019
e09fd78
resolve merge conflict
SimonLab Dec 6, 2019
d4be7e7
Merge pull request #41 from dwyl/update-auth-dependency-#258
nelsonic Dec 6, 2019
b40c483
add registration changeset for profile, #247
SimonLab Dec 10, 2019
cbfa4bd
add register action for person, #247
SimonLab Dec 10, 2019
cd63d22
remove coneonin as Fields manages hashing, #247
SimonLab Dec 10, 2019
b0ead6d
authenticate user with email password, #247
SimonLab Dec 10, 2019
ffbccf1
update and remove unused dependencies in mix.lock file, #247
SimonLab Dec 10, 2019
2baaa94
add test and verify email for existing account, #247
SimonLab Dec 10, 2019
326977f
create session linked to email user, #237
SimonLab Dec 10, 2019
557c736
Merge pull request #42 from dwyl/simple-auth-email-#247
nelsonic Dec 10, 2019
c740b63
remove unnecessary configuration for elixir_auth_google, #247
SimonLab Dec 11, 2019
9f6467d
remove IO.inspect, #247
SimonLab Dec 11, 2019
50391a4
Update lib/app_web/templates/page/index.html.eex
SimonLab Dec 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/app/ctx/person.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ defmodule App.Ctx.Person do
field :email_hash, :binary
field :familyName, :binary
field :givenName, :binary
field :key_id, :integer
field :password_hash, :binary
field :username, :binary
field :username_hash, :binary
Expand Down
9 changes: 9 additions & 0 deletions priv/repo/migrations/20191127112248_remove_people_key_id.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule App.Repo.Migrations.RemovePeopleKeyId do
use Ecto.Migration

def change do
alter table("people") do
remove :key_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonLab :key_id is for storing the id of the encryption key used to encrypt the data in the same row as the data so that it's clear which key to use to decrypt it.
Are you planning to store the encryption key id somewhere else? 💭

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the key_id has been added to the sessions table
see dwyl/app#247 (comment)

Copy link
Member

@nelsonic nelsonic Nov 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonLab yeah, I saw that 👍
However I expect the data in these two tables will be encrypted with different encryption keys. If someone registers to use the App using just an email address and password dwyl/app#237 (a use-case we will 100% be adding to support people who don't have/use Google Accounts) Then we will need to have key_id in the people table to know which encryption key was used to encrypt their data on sign-up. On each subsequent login the session data (e.g: IP Address and Browser User Agent) will be encrypted and stored in the sessions table possibly with a different encryption key because of our key rotation system. 💭

Apologies that this is not clearly mapped out ... I don't expect you to guess what's in my head. 🙄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes makes sense, sorry I was focused on the google auth and hasn't thought of keeping the specific key_id for email/password authentication. I'll add it back 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad with the new solution for this. in-lining the key_id is more "user-friendly" (to devs) 👍

end
end
end