-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Boulevard/lnikkila/token-structs
Use separate structs for request and access tokens
- Loading branch information
Showing
10 changed files
with
166 additions
and
103 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
defmodule ExQuickBooks.RequestToken do | ||
@moduledoc """ | ||
OAuth 1.0a token/secret pair for requesting an access token. | ||
See `ExQuickBooks.OAuth` for documentation on how to obtain these tokens. | ||
## Structure | ||
The token is technically a public/private key pair: | ||
- `:token` - | ||
The public key binary. | ||
- `:token_secret` - | ||
The private key binary. | ||
- `:redirect_url` - | ||
URL where you should redirect the user to continue authentication. | ||
The token is sent with API requests, but the secret is only used to calculate | ||
the request signatures. | ||
## Storing the token | ||
You can store this token in the user’s session until the OAuth callback. Make | ||
sure the session storage is encrypted. | ||
""" | ||
|
||
@type t :: %__MODULE__{ | ||
token: binary, | ||
token_secret: binary, | ||
redirect_url: binary | ||
} | ||
|
||
@enforce_keys [ | ||
:token, | ||
:token_secret, | ||
:redirect_url | ||
] | ||
|
||
defstruct @enforce_keys | ||
end |
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.