-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implements findUserByMe
endpoint + trimmings
#19
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
95f1a88
WIP: Authentication
gbdubs a42a75c
Merge branch 'main' into grady/authn
gbdubs f326745
Updates to New Way Of Things
gbdubs 5e2974f
Finishing touches
gbdubs 4fef9a0
Lintfix
gbdubs 899a41f
Merge branch 'main' into grady/authn
gbdubs 8807989
Addresses Review Comments
gbdubs 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 |
---|---|---|
|
@@ -26,17 +26,32 @@ func initiativeToOAPI(i *pacta.Initiative) (*api.Initiative, error) { | |
}, nil | ||
} | ||
|
||
func userToOAPI(user *pacta.User) (*api.User, error) { | ||
if user == nil { | ||
return nil, errorInternal(fmt.Errorf("userToOAPI: can't convert nil pointer")) | ||
Comment on lines
+29
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember you had a reason for using |
||
} | ||
return &api.User{ | ||
Admin: user.Admin, | ||
CanonicalEmail: &user.CanonicalEmail, | ||
EnteredEmail: user.EnteredEmail, | ||
Id: string(user.ID), | ||
Name: user.Name, | ||
PreferredLanguage: api.UserPreferredLanguage(user.PreferredLanguage), | ||
SuperAdmin: user.SuperAdmin, | ||
}, nil | ||
} | ||
|
||
func pactaVersionToOAPI(pv *pacta.PACTAVersion) (*api.PactaVersion, error) { | ||
if pv == nil { | ||
return nil, errorInternal(fmt.Errorf("pactaVersionToOAPI: can't convert nil pointer")) | ||
} | ||
return &api.PactaVersion{ | ||
CreatedAt: pv.CreatedAt, | ||
Description: pv.Description, | ||
Digest: pv.Digest, | ||
Id: string(pv.ID), | ||
Name: pv.Name, | ||
IsDefault: pv.IsDefault, | ||
Digest: pv.Digest, | ||
Description: pv.Description, | ||
CreatedAt: pv.CreatedAt, | ||
Name: pv.Name, | ||
}, nil | ||
} | ||
|
||
|
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
I hear your point about keeping all the
conv
stuff in thepactasrv
package so you can access these, but my counterpoint would be that determining the 'type' of an error truly is a concern of the server, and this should just return afmt.Errorf(...)
or someconv
-specific error that thesrv
layer then converts into anerrorWhatever
Functionally, it probably doesn't matter, just cleaner abstractions and easier testing