mirror of https://github.com/hashicorp/boundary
feat(repository): Implement Create project app token functionality (#6343)
* Squash: merge app-token-prototype into mikemountain-sql-schema-and-pgtap-tests * add pgtap tests and fkeys * wip * [ICU-18111] implement repository create functionality for org, refactor create code to handle multiple scope types * wip * update to include description * make gen proto * add nil check * update tests * pr comments * address pr comments and tweak some logic * merge issues * fix logic in permissionspull/6420/merge
parent
6ea32ecbc9
commit
5f3d4a449d
@ -0,0 +1,251 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc (unknown)
|
||||
// source: controller/storage/apptoken/store/v1/apptoken_project.proto
|
||||
|
||||
package store
|
||||
|
||||
import (
|
||||
timestamp "github.com/hashicorp/boundary/internal/db/timestamp"
|
||||
_ "github.com/hashicorp/boundary/sdk/pbs/controller/protooptions"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// AppTokenProject represents app tokens created in project scope
|
||||
type AppTokenProject struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// public_id is used to access the App Token via an API
|
||||
// @inject_tag: gorm:"primary_key"
|
||||
PublicId string `protobuf:"bytes,1,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty" gorm:"primary_key"`
|
||||
// scope id for the app token
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
ScopeId string `protobuf:"bytes,2,opt,name=scope_id,json=scopeId,proto3" json:"scope_id,omitempty" gorm:"default:null"`
|
||||
// name is the optional friendly name used to
|
||||
// access the App Token via an API
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty" gorm:"default:null"`
|
||||
// description of the app token
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty" gorm:"default:null"`
|
||||
// control if this app token has been revoked
|
||||
// @inject_tag: `gorm:"default:false"`
|
||||
Revoked bool `protobuf:"varint,5,opt,name=revoked,proto3" json:"revoked,omitempty" gorm:"default:false"`
|
||||
// create_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp"`
|
||||
CreateTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:current_timestamp"`
|
||||
// update_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp"`
|
||||
UpdateTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:current_timestamp"`
|
||||
// created_by_user_id is the ID of the user that created this App Token
|
||||
// @inject_tag: `gorm:"default:not_null"`
|
||||
CreatedByUserId string `protobuf:"bytes,8,opt,name=created_by_user_id,json=createdByUserId,proto3" json:"created_by_user_id,omitempty" gorm:"default:not_null"`
|
||||
// approximate_last_access_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp"`
|
||||
ApproximateLastAccessTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=approximate_last_access_time,json=approximateLastAccessTime,proto3" json:"approximate_last_access_time,omitempty" gorm:"default:current_timestamp"`
|
||||
// time_to_stale_seconds is the number of seconds of inactivity after which
|
||||
// the token is considered stale
|
||||
TimeToStaleSeconds uint32 `protobuf:"varint,10,opt,name=time_to_stale_seconds,json=timeToStaleSeconds,proto3" json:"time_to_stale_seconds,omitempty"`
|
||||
// expiration_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp + interval '3 years'"`
|
||||
ExpirationTime *timestamp.Timestamp `protobuf:"bytes,11,opt,name=expiration_time,json=expirationTime,proto3" json:"expiration_time,omitempty" gorm:"default:current_timestamp + interval '3 years'"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) Reset() {
|
||||
*x = AppTokenProject{}
|
||||
mi := &file_controller_storage_apptoken_store_v1_apptoken_project_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AppTokenProject) ProtoMessage() {}
|
||||
|
||||
func (x *AppTokenProject) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_storage_apptoken_store_v1_apptoken_project_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AppTokenProject.ProtoReflect.Descriptor instead.
|
||||
func (*AppTokenProject) Descriptor() ([]byte, []int) {
|
||||
return file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetPublicId() string {
|
||||
if x != nil {
|
||||
return x.PublicId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetScopeId() string {
|
||||
if x != nil {
|
||||
return x.ScopeId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetRevoked() bool {
|
||||
if x != nil {
|
||||
return x.Revoked
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetCreateTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreateTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetUpdateTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdateTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetCreatedByUserId() string {
|
||||
if x != nil {
|
||||
return x.CreatedByUserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetApproximateLastAccessTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.ApproximateLastAccessTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetTimeToStaleSeconds() uint32 {
|
||||
if x != nil {
|
||||
return x.TimeToStaleSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AppTokenProject) GetExpirationTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.ExpirationTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_controller_storage_apptoken_store_v1_apptoken_project_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
";controller/storage/apptoken/store/v1/apptoken_project.proto\x12$controller.storage.apptoken.store.v1\x1a*controller/custom_options/v1/options.proto\x1a/controller/storage/timestamp/v1/timestamp.proto\"\x87\x05\n" +
|
||||
"\x0fAppTokenProject\x12\x1b\n" +
|
||||
"\tpublic_id\x18\x01 \x01(\tR\bpublicId\x12\x19\n" +
|
||||
"\bscope_id\x18\x02 \x01(\tR\ascopeId\x12$\n" +
|
||||
"\x04name\x18\x03 \x01(\tB\x10\xc2\xdd)\f\n" +
|
||||
"\x04name\x12\x04nameR\x04name\x12@\n" +
|
||||
"\vdescription\x18\x04 \x01(\tB\x1e\xc2\xdd)\x1a\n" +
|
||||
"\vdescription\x12\vdescriptionR\vdescription\x12\x18\n" +
|
||||
"\arevoked\x18\x05 \x01(\bR\arevoked\x12K\n" +
|
||||
"\vcreate_time\x18\x06 \x01(\v2*.controller.storage.timestamp.v1.TimestampR\n" +
|
||||
"createTime\x12K\n" +
|
||||
"\vupdate_time\x18\a \x01(\v2*.controller.storage.timestamp.v1.TimestampR\n" +
|
||||
"updateTime\x12+\n" +
|
||||
"\x12created_by_user_id\x18\b \x01(\tR\x0fcreatedByUserId\x12k\n" +
|
||||
"\x1capproximate_last_access_time\x18\t \x01(\v2*.controller.storage.timestamp.v1.TimestampR\x19approximateLastAccessTime\x121\n" +
|
||||
"\x15time_to_stale_seconds\x18\n" +
|
||||
" \x01(\rR\x12timeToStaleSeconds\x12S\n" +
|
||||
"\x0fexpiration_time\x18\v \x01(\v2*.controller.storage.timestamp.v1.TimestampR\x0eexpirationTimeB=Z;github.com/hashicorp/boundary/internal/apptoken/store;storeb\x06proto3"
|
||||
|
||||
var (
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescOnce sync.Once
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescGZIP() []byte {
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescOnce.Do(func() {
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDesc), len(file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDesc)))
|
||||
})
|
||||
return file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_storage_apptoken_store_v1_apptoken_project_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_controller_storage_apptoken_store_v1_apptoken_project_proto_goTypes = []any{
|
||||
(*AppTokenProject)(nil), // 0: controller.storage.apptoken.store.v1.AppTokenProject
|
||||
(*timestamp.Timestamp)(nil), // 1: controller.storage.timestamp.v1.Timestamp
|
||||
}
|
||||
var file_controller_storage_apptoken_store_v1_apptoken_project_proto_depIdxs = []int32{
|
||||
1, // 0: controller.storage.apptoken.store.v1.AppTokenProject.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
1, // 1: controller.storage.apptoken.store.v1.AppTokenProject.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
1, // 2: controller.storage.apptoken.store.v1.AppTokenProject.approximate_last_access_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
1, // 3: controller.storage.apptoken.store.v1.AppTokenProject.expiration_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_storage_apptoken_store_v1_apptoken_project_proto_init() }
|
||||
func file_controller_storage_apptoken_store_v1_apptoken_project_proto_init() {
|
||||
if File_controller_storage_apptoken_store_v1_apptoken_project_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDesc), len(file_controller_storage_apptoken_store_v1_apptoken_project_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_storage_apptoken_store_v1_apptoken_project_proto_goTypes,
|
||||
DependencyIndexes: file_controller_storage_apptoken_store_v1_apptoken_project_proto_depIdxs,
|
||||
MessageInfos: file_controller_storage_apptoken_store_v1_apptoken_project_proto_msgTypes,
|
||||
}.Build()
|
||||
File_controller_storage_apptoken_store_v1_apptoken_project_proto = out.File
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_proto_goTypes = nil
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_proto_depIdxs = nil
|
||||
}
|
||||
@ -0,0 +1,164 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc (unknown)
|
||||
// source: controller/storage/apptoken/store/v1/apptoken_project_permission.proto
|
||||
|
||||
package store
|
||||
|
||||
import (
|
||||
_ "github.com/hashicorp/boundary/sdk/pbs/controller/protooptions"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// AppTokenPermissionProject represents app token permissions created in project scope
|
||||
type AppTokenPermissionProject struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// individual id for the app token's permission
|
||||
// @inject_tag: gorm:"primary_key"
|
||||
PrivateId string `protobuf:"bytes,1,opt,name=private_id,json=privateId,proto3" json:"private_id,omitempty" gorm:"primary_key"`
|
||||
// associated app token id
|
||||
AppTokenId string `protobuf:"bytes,2,opt,name=app_token_id,json=appTokenId,proto3" json:"app_token_id,omitempty"`
|
||||
// description of the app token permission
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty" gorm:"default:null"`
|
||||
// control if this app token permission has been granted "this" scope
|
||||
// @inject_tag: `gorm:"default:false"`
|
||||
GrantThisScope bool `protobuf:"varint,5,opt,name=grant_this_scope,json=grantThisScope,proto3" json:"grant_this_scope,omitempty" gorm:"default:false"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AppTokenPermissionProject) Reset() {
|
||||
*x = AppTokenPermissionProject{}
|
||||
mi := &file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AppTokenPermissionProject) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AppTokenPermissionProject) ProtoMessage() {}
|
||||
|
||||
func (x *AppTokenPermissionProject) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AppTokenPermissionProject.ProtoReflect.Descriptor instead.
|
||||
func (*AppTokenPermissionProject) Descriptor() ([]byte, []int) {
|
||||
return file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AppTokenPermissionProject) GetPrivateId() string {
|
||||
if x != nil {
|
||||
return x.PrivateId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenPermissionProject) GetAppTokenId() string {
|
||||
if x != nil {
|
||||
return x.AppTokenId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenPermissionProject) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AppTokenPermissionProject) GetGrantThisScope() bool {
|
||||
if x != nil {
|
||||
return x.GrantThisScope
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_controller_storage_apptoken_store_v1_apptoken_project_permission_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"Fcontroller/storage/apptoken/store/v1/apptoken_project_permission.proto\x12$controller.storage.apptoken.store.v1\x1a*controller/custom_options/v1/options.proto\"\xc8\x01\n" +
|
||||
"\x19AppTokenPermissionProject\x12\x1d\n" +
|
||||
"\n" +
|
||||
"private_id\x18\x01 \x01(\tR\tprivateId\x12 \n" +
|
||||
"\fapp_token_id\x18\x02 \x01(\tR\n" +
|
||||
"appTokenId\x12@\n" +
|
||||
"\vdescription\x18\x03 \x01(\tB\x1e\xc2\xdd)\x1a\n" +
|
||||
"\vdescription\x12\vdescriptionR\vdescription\x12(\n" +
|
||||
"\x10grant_this_scope\x18\x05 \x01(\bR\x0egrantThisScopeB=Z;github.com/hashicorp/boundary/internal/apptoken/store;storeb\x06proto3"
|
||||
|
||||
var (
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescOnce sync.Once
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescGZIP() []byte {
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescOnce.Do(func() {
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDesc), len(file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDesc)))
|
||||
})
|
||||
return file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_goTypes = []any{
|
||||
(*AppTokenPermissionProject)(nil), // 0: controller.storage.apptoken.store.v1.AppTokenPermissionProject
|
||||
}
|
||||
var file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_init() }
|
||||
func file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_init() {
|
||||
if File_controller_storage_apptoken_store_v1_apptoken_project_permission_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDesc), len(file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_goTypes,
|
||||
DependencyIndexes: file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_depIdxs,
|
||||
MessageInfos: file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_msgTypes,
|
||||
}.Build()
|
||||
File_controller_storage_apptoken_store_v1_apptoken_project_permission_proto = out.File
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_goTypes = nil
|
||||
file_controller_storage_apptoken_store_v1_apptoken_project_permission_proto_depIdxs = nil
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.storage.apptoken.store.v1;
|
||||
|
||||
import "controller/custom_options/v1/options.proto";
|
||||
import "controller/storage/timestamp/v1/timestamp.proto";
|
||||
|
||||
option go_package = "github.com/hashicorp/boundary/internal/apptoken/store;store";
|
||||
|
||||
// AppTokenProject represents app tokens created in project scope
|
||||
message AppTokenProject {
|
||||
// public_id is used to access the App Token via an API
|
||||
// @inject_tag: gorm:"primary_key"
|
||||
string public_id = 1;
|
||||
|
||||
// scope id for the app token
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
string scope_id = 2;
|
||||
|
||||
// name is the optional friendly name used to
|
||||
// access the App Token via an API
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
string name = 3 [(custom_options.v1.mask_mapping) = {
|
||||
this: "name"
|
||||
that: "name"
|
||||
}];
|
||||
|
||||
// description of the app token
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
string description = 4 [(custom_options.v1.mask_mapping) = {
|
||||
this: "description"
|
||||
that: "description"
|
||||
}];
|
||||
|
||||
// control if this app token has been revoked
|
||||
// @inject_tag: `gorm:"default:false"`
|
||||
bool revoked = 5;
|
||||
|
||||
// create_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp"`
|
||||
timestamp.v1.Timestamp create_time = 6;
|
||||
|
||||
// update_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp"`
|
||||
timestamp.v1.Timestamp update_time = 7;
|
||||
|
||||
// created_by_user_id is the ID of the user that created this App Token
|
||||
// @inject_tag: `gorm:"default:not_null"`
|
||||
string created_by_user_id = 8;
|
||||
|
||||
// approximate_last_access_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp"`
|
||||
timestamp.v1.Timestamp approximate_last_access_time = 9;
|
||||
|
||||
// time_to_stale_seconds is the number of seconds of inactivity after which
|
||||
// the token is considered stale
|
||||
uint32 time_to_stale_seconds = 10;
|
||||
|
||||
// expiration_time from the RDBMS
|
||||
// @inject_tag: `gorm:"default:current_timestamp + interval '3 years'"`
|
||||
timestamp.v1.Timestamp expiration_time = 11;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.storage.apptoken.store.v1;
|
||||
|
||||
import "controller/custom_options/v1/options.proto";
|
||||
|
||||
option go_package = "github.com/hashicorp/boundary/internal/apptoken/store;store";
|
||||
|
||||
// AppTokenPermissionProject represents app token permissions created in project scope
|
||||
message AppTokenPermissionProject {
|
||||
// individual id for the app token's permission
|
||||
// @inject_tag: gorm:"primary_key"
|
||||
string private_id = 1;
|
||||
|
||||
// associated app token id
|
||||
string app_token_id = 2;
|
||||
|
||||
// description of the app token permission
|
||||
// @inject_tag: `gorm:"default:null"`
|
||||
string description = 3 [(custom_options.v1.mask_mapping) = {
|
||||
this: "description"
|
||||
that: "description"
|
||||
}];
|
||||
|
||||
// control if this app token permission has been granted "this" scope
|
||||
// @inject_tag: `gorm:"default:false"`
|
||||
bool grant_this_scope = 5;
|
||||
}
|
||||
Loading…
Reference in new issue