2022-04-29 09:52:01 -04:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-02-02 17:15:17 -08:00
|
|
|
|
2021-07-26 14:03:15 -04:00
|
|
|
// Package boundary contains global interfaces and other definitions that
|
|
|
|
|
// define the Boundary domain.
|
|
|
|
|
package boundary
|
|
|
|
|
|
2022-04-29 09:52:01 -04:00
|
|
|
import (
|
|
|
|
|
"github.com/hashicorp/boundary/internal/db/timestamp"
|
2023-10-23 15:53:29 -07:00
|
|
|
"github.com/hashicorp/boundary/internal/types/resource"
|
2022-04-29 09:52:01 -04:00
|
|
|
)
|
2021-07-26 14:03:15 -04:00
|
|
|
|
|
|
|
|
// An Entity is an object distinguished by its identity, rather than its
|
|
|
|
|
// attributes. It can contain value objects and other entities.
|
|
|
|
|
type Entity interface {
|
|
|
|
|
GetPublicId() string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// An Aggregate is an entity that is the root of a transactional
|
|
|
|
|
// consistency boundary.
|
|
|
|
|
type Aggregate interface {
|
|
|
|
|
Entity
|
|
|
|
|
GetVersion() uint32
|
|
|
|
|
GetCreateTime() *timestamp.Timestamp
|
|
|
|
|
GetUpdateTime() *timestamp.Timestamp
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-23 15:53:29 -07:00
|
|
|
// A Resource is an aggregate with a name, description, and resource type.
|
2021-07-26 14:03:15 -04:00
|
|
|
type Resource interface {
|
|
|
|
|
Aggregate
|
|
|
|
|
GetName() string
|
|
|
|
|
GetDescription() string
|
2023-10-23 15:53:29 -07:00
|
|
|
GetResourceType() resource.Type
|
2021-07-26 14:03:15 -04:00
|
|
|
}
|
2022-04-29 09:52:01 -04:00
|
|
|
|
|
|
|
|
// AuthzProtectedEntity is used by some functions (primarily
|
|
|
|
|
// scopeids.AuthzProtectedEntityProvider-conforming implementations) to deliver
|
|
|
|
|
// some common information necessary for calculating authz.
|
|
|
|
|
type AuthzProtectedEntity interface {
|
|
|
|
|
Entity
|
2022-07-20 16:24:46 -07:00
|
|
|
GetProjectId() string
|
2022-04-29 09:52:01 -04:00
|
|
|
GetUserId() string
|
|
|
|
|
}
|