mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-23 00:23:36 +01:00
add comments for exported functions
This commit is contained in:
parent
cb8abacadd
commit
ed470d7dbe
@ -11,6 +11,7 @@ import (
|
||||
"github.com/rs/xid"
|
||||
)
|
||||
|
||||
// PersonalAccessToken holds all information about a PAT including a hashed version of it for verification
|
||||
type PersonalAccessToken struct {
|
||||
ID string
|
||||
Description string
|
||||
@ -22,6 +23,8 @@ type PersonalAccessToken struct {
|
||||
LastUsed time.Time
|
||||
}
|
||||
|
||||
// CreateNewPAT will generate a new PersonalAccessToken that can be assigned to a User.
|
||||
// Additionally, it will return the token in plain text once, to give to the user and only save a hashed version
|
||||
func CreateNewPAT(description string, expirationInDays int, createdBy string) (*PersonalAccessToken, string) {
|
||||
hashedToken, plainToken := generateNewToken()
|
||||
currentTime := time.Now().UTC()
|
||||
|
Loading…
Reference in New Issue
Block a user