-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Both method and token are required. Also expose a `GetUserWithHV` function since it is possible to trigger HV after successful login. It's advised that all clients get the user details after login to handle this workflow.
- Loading branch information
1 parent
8f03c5a
commit d275edd
Showing
3 changed files
with
26 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package proton | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/go-resty/resty/v2" | ||
) | ||
|
||
func addHVToRequest(req *resty.Request, hv *APIHVDetails) *resty.Request { | ||
if hv == nil { | ||
return req | ||
} | ||
|
||
return req.SetHeader(hvPMTokenHeaderField, hv.Token).SetHeader(hvPMTokenType, strings.Join(hv.Methods, ",")) | ||
} |
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