forked from zoom-lib-golang/zoom-lib-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rafe Colton
committed
Dec 3, 2018
1 parent
e8f4cd6
commit 83a2758
Showing
5 changed files
with
120 additions
and
124 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
package zoom | ||
|
||
import "net/http" | ||
|
||
// HTTPMethod is the HTTP request method types | ||
type HTTPMethod string | ||
|
||
const ( | ||
// Get is GET HTTP method | ||
Get HTTPMethod = http.MethodGet | ||
|
||
// Post is POST HTTP method | ||
Post HTTPMethod = http.MethodPost | ||
|
||
// Put is PUT HTTP method | ||
Put HTTPMethod = http.MethodPut | ||
|
||
// Patch is PATCH HTTP method | ||
Patch HTTPMethod = http.MethodPatch | ||
|
||
// Delete is DELETE HTTP method | ||
Delete HTTPMethod = http.MethodDelete | ||
) |
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,18 @@ | ||
package zoom | ||
|
||
import ( | ||
"time" | ||
|
||
"gopkg.in/dgrijalva/jwt-go.v3" | ||
) | ||
|
||
func jwtToken(key string, secret string) (string, error) { | ||
claims := &jwt.StandardClaims{ | ||
Issuer: key, | ||
ExpiresAt: jwt.TimeFunc().Local().Add(time.Second * time.Duration(5000)).Unix(), | ||
} | ||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) | ||
token.Header["alg"] = "HS256" | ||
token.Header["typ"] = "JWT" | ||
return token.SignedString([]byte(secret)) | ||
} |
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