projectbinding

package
v1.800.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeProject

func NormalizeProject(project string) string

NormalizeProject folds the default project onto the canonical "" scope, matching spendalert.NormalizeProject and the cloud principal resolver, so a request's project resolves to its binding exactly as the org-wide default row is matched.

func Query

Types

type ProjectBinding

type ProjectBinding struct {
	mixin.Model[ProjectBinding]

	// Project is the project slug within the org; "" = the default scope.
	Project string `json:"project"`

	// BillingAccountId is the funding BillingAccount.Id().
	BillingAccountId string `json:"billingAccountId"`
}

ProjectBinding links one of the org's projects to the BillingAccount that funds it (GCP's Project.billingAccountId). It is the SINGLE source of truth for "which account does this project's usage debit": the token's billing_account claim is a signed cache of this row, and the debit-time resolver reads THIS row, never a client header. A project with no binding draws the org's Default account (or the org-wide pool if the org has none). Project "" is the org's default scope.

func New

func (*ProjectBinding) Validator

func (p *ProjectBinding) Validator() *val.Validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL