-
Notifications
You must be signed in to change notification settings - Fork 2
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
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 67b3afd
add elixir_auth_google to application, #247
SimonLab 39d6a73
update mix dependencies, https://github.com/dwyl/app/issues/247
SimonLab 0e56d9d
update travis configuration to user elixir 1.9, https://github.com/dw…
SimonLab 93dae3b
create sessions table, #247
SimonLab f2a9560
add schema for session, #247
SimonLab f8bb841
remove key_id from people, #247
SimonLab d0e937c
create new people on authentication, #247
SimonLab 2501c05
add association people sessions, #247
SimonLab a4ac4f6
test inserted encrypted token in session table, #247
SimonLab 9e1bf7d
use binary type to save tokens in Postgres, #247
SimonLab d0d7d8d
use published (alpha) version of elixir_auth_google in mix.exs
nelsonic 9fbfc44
use published version 0.1.8 of fields from hex.pm
nelsonic b263c29
use :fields v2.0.0 (published hex.pm package) in mix.exs
nelsonic 8b0cf3a
add Blue Sign-in With Google Button fixes #249
nelsonic eee6a81
add .dwyl-teal and .dwyl-bg-teal to app.css for #247 UI
nelsonic 76b6da0
comment out "workflow" buttons (for now)
nelsonic 6a55b12
rename Google Auth route from /google-auth-callback to /google/auth/c…
nelsonic ba50a84
update test assertion copy to just "effectiveness" in light of copy c…
nelsonic 4744edb
add favicons to main template https://github.com/dwyl/app/issues/125
nelsonic 462a139
create AppWeb.GoogleAuthControllerTest to test auth helper functions …
nelsonic 4b00297
fix typo in mix.exs
nelsonic f396832
add initial implementation of transform_profile_data_to_person/1 for …
nelsonic 6ee71e5
derp! fix typo in transform_profile_data_to_person/1 proflie > profil…
nelsonic 0845898
remove Map.get(profile, "email") in favour of profile["email"] #247
nelsonic 315227a
FFS! fix typo in transform_profile_data_to_person/1
nelsonic 046ec91
update version of Erlang to 22.0 in elixir_buildpack.config to match …
nelsonic 32ed44c
add "picture" to transform_profile_data_to_person/1 for #247 https://…
nelsonic 2763753
create migration to add locale and picture to people schema https://g…
nelsonic d5210d2
fix broken tests #247
nelsonic 96b42b0
add picture, locale givenName, familyName status to people table http…
nelsonic 0df8f00
re-enable sessions in google_auth_controller.ex
nelsonic fb167b6
update field type of person.email to Fields.EmailEncrypted and update…
nelsonic 3193b97
update version of Fields dep to 2.0.1 to ensure hashing uses SECRET_K…
nelsonic 86d8fab
restore previously known (working/tests passing) state ahead of attem…
nelsonic cf2f60a
comment out all session pre-loading code https://github.com/dwyl/app/…
nelsonic 9c16aca
update version of Fields to 2.1.0 adds Name field
nelsonic 053d135
setup "welcome" template for Google Auth #247
nelsonic 482ce15
simplify google_auth view & template
nelsonic 02703b1
add person["picture"] to welcome template ... needs styling ... #247
nelsonic bddf885
display "Welcome {person.name}!" once authenticated #247
nelsonic 5288457
Merge branch 'master' into google-authentication-#247
nelsonic b8ad2a0
Merge branch 'master' into google-authentication-#247
nelsonic 5e66418
fix typo in mix.exs
nelsonic 3a77332
update version of elixir-auth-google package to 0.1.0 (hard code redi…
nelsonic 5a9a0fd
update ElixirAuthGoogle function invocations to pass in Plug.conn #247
nelsonic fa855e6
fix typo in url /google/auth/callback should be /auth/google/callback…
nelsonic 1901157
add auth controller, #252
SimonLab 09bb4d6
rename auth controller, #252
SimonLab 08c8b3b
remove auth controller, to be added on a seperate PR, #252
SimonLab 17fc58f
add auth controller, #252
SimonLab 30163cf
merge google-authentication branch
SimonLab 3c90279
add auth as plug to restricted endpoint, #252
SimonLab 52b78b3
assign person id to session, #252
SimonLab 2702d30
test google_auth controller, #252
SimonLab 1b4550c
update test for restricted endpoints, #252
SimonLab 027bc20
update tests to use EmailHash field, #29
SimonLab 3e7e9f9
update get_by_email to search on the emailHash, #29
SimonLab 8e4640a
Merge pull request #30 from dwyl/person-session-#252
nelsonic 198fc40
Merge pull request #31 from dwyl/has-email-#29
nelsonic 2252503
compare email_hash
SimonLab 2901afe
Merge branch 'google-authentication-#247' into avoid-peson-duplicate-#29
SimonLab 01fb000
Merge pull request #32 from dwyl/person-session-#252
SimonLab 0b7ad81
Merge branch 'google-authentication-#247' into avoid-peson-duplicate-#29
SimonLab 4a7f135
parse email attribute, #29
SimonLab 6e68240
define put_email_hash function, #29
SimonLab 96198e9
access person data with ., #29
SimonLab bb81c1a
Merge pull request #33 from dwyl/avoid-peson-duplicate-#29
nelsonic 2c7565e
redirect to user info page when loggedin, #34
SimonLab e4d865d
update test for info person, #34
SimonLab 1dbfd08
Merge pull request #36 from dwyl/user-info-#34
nelsonic 8be04f1
use Fields custom type, #25
SimonLab 356b856
Merge branch 'google-authentication-#247' into update-field-types-#25
SimonLab 6f32e0d
Merge pull request #37 from dwyl/update-field-types-#25
nelsonic de44e63
add seed data for status, #247
SimonLab ea86da3
set status verified to person on google authentication, #247
SimonLab 21bd695
run seed migration before test, #247
SimonLab 7d5eaab
update ctx test for status, #247
SimonLab ccde1f2
add back create_status fct, #247
SimonLab 4c96ce3
Merge pull request #38 from dwyl/google-email-status-#247
nelsonic 95b7877
DRY out GoogleAuthController code see: https://github.com/dwyl/app/is…
nelsonic 338abae
update dependency for elixir_auth_google, #258
SimonLab 7a4e065
update test to match new map structure of profile, #258
SimonLab b0eee0e
update get_user_profile to use atom syntax in map https://github.com/…
nelsonic 9937954
update profile map to use atoms, #258
SimonLab e09fd78
resolve merge conflict
SimonLab d4be7e7
Merge pull request #41 from dwyl/update-auth-dependency-#258
nelsonic b40c483
add registration changeset for profile, #247
SimonLab cbfa4bd
add register action for person, #247
SimonLab cd63d22
remove coneonin as Fields manages hashing, #247
SimonLab b0ead6d
authenticate user with email password, #247
SimonLab ffbccf1
update and remove unused dependencies in mix.lock file, #247
SimonLab 2baaa94
add test and verify email for existing account, #247
SimonLab 326977f
create session linked to email user, #237
SimonLab 557c736
Merge pull request #42 from dwyl/simple-auth-email-#247
nelsonic c740b63
remove unnecessary configuration for elixir_auth_google, #247
SimonLab 9f6467d
remove IO.inspect, #247
SimonLab 50391a4
Update lib/app_web/templates/page/index.html.eex
SimonLab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
? 💭There was a problem hiding this comment.
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
tablesee dwyl/app#247 (comment)
There was a problem hiding this comment.
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 thepeople
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 thesessions
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. 🙄
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
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) 👍