// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1

syntax = "proto3";

// Package store provides protobufs for storing types in the credential package.
package controller.storage.credential.store.v1;

option go_package = "github.com/hashicorp/boundary/internal/credential/store;store";

message Store {
  // public_id is a surrogate key suitable for use in a public API.
  // @inject_tag: `gorm:"primary_key"`
  string public_id = 1;

  // The project_id of the owning project and must be set.
  // @inject_tag: `gorm:"not_null"`
  string project_id = 2;
}

message Library {
  // public_id is a surrogate key suitable for use in a public API.
  // @inject_tag: `gorm:"primary_key"`
  string public_id = 1;

  // The store_id of the owning store and must be set.
  // @inject_tag: `gorm:"not_null"`
  string store_id = 2;

  // credential_type is optional. If set, it indicates the type of
  // credential the library returns.
  // @inject_tag: `gorm:"default:null"`
  string credential_type = 3;
}

message Credential {
  // public_id is a surrogate key suitable for use in a public API.
  // @inject_tag: `gorm:"primary_key"`
  string public_id = 1;
}

message Static {
  // public_id is a surrogate key suitable for use in a public API.
  // @inject_tag: `gorm:"primary_key"`
  string public_id = 1;

  // The store_id of the owning store and must be set.
  // @inject_tag: `gorm:"not_null"`
  string store_id = 2;
}

message Dynamic {
  // public_id is a surrogate key suitable for use in a public API.
  // @inject_tag: `gorm:"primary_key"`
  string public_id = 1;

  // The library_id of the owning library and must be set.
  // @inject_tag: `gorm:"not_null"`
  string library_id = 2;
}
