mirror of
https://github.com/harness/drone.git
synced 2025-05-05 01:50:05 +08:00

Adds the basic for harness embedded mode: - Harness dedicated router with custom APIHandler - Inline Space Creation - Client for Account/Org/Project - Bootstrap (Allows for automated creation of admin user and gitness service (used for all platform required ops)) - Inline harness service principal creation - Ignore flag for ACL.
30 lines
1.2 KiB
Go
30 lines
1.2 KiB
Go
// Copyright 2022 Harness Inc. All rights reserved.
|
|
// Use of this source code is governed by the Polyform Free Trial License
|
|
// that can be found in the LICENSE.md file for this repository.
|
|
|
|
package types
|
|
|
|
import (
|
|
"github.com/harness/gitness/types/enum"
|
|
)
|
|
|
|
// Represents server side infos stored for tokens we distribute.
|
|
type Token struct {
|
|
// TODO: int64 ID doesn't match DB
|
|
ID int64 `db:"token_id" json:"id"`
|
|
Type enum.TokenType `db:"token_type" json:"type"`
|
|
Name string `db:"token_name" json:"name"`
|
|
// TODO: change name to OwnerID?
|
|
PrincipalID int64 `db:"token_principalId" json:"principalId"`
|
|
ExpiresAt int64 `db:"token_expiresAt" json:"expiresAt"`
|
|
IssuedAt int64 `db:"token_issuedAt" json:"issuedAt"`
|
|
Grants enum.AccessGrant `db:"token_grants" json:"grants"`
|
|
CreatedBy int64 `db:"token_createdBy" json:"createdBy"`
|
|
}
|
|
|
|
// TokenResponse is returned as part of token creation for PAT / SAT / User Session.
|
|
type TokenResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
Token Token `json:"token"`
|
|
}
|