models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package models provides custom object definitions for the core api

Index

Constants

View Source
const (
	// DefaultRevision is the default revision to be used for new records
	DefaultRevision = "v0.0.1"
)
View Source
const (
	// MaxRunsInBetween defines how much time each job must have between runs
	// Maybe make this configurable or maybe we need to take this down to like
	// 5/10 minutes
	MaxRunsInBetween = 30 * time.Minute
)

Variables

View Source
var (
	ErrUnsupportedDateTimeType = errors.New("unsupported time format")
	ErrInvalidTimeType         = errors.New("invalid date format, expected YYYY-MM-DD or full ISO8601")
)
View Source
var (
	// ErrInvalidURL defines an invalid url
	ErrInvalidURL = errors.New("invalid url provided")
	// ErrLocalHostNotAllowed defines an error where a user tries to run ssl checks on a localhost address
	ErrLocalHostNotAllowed = errors.New("cannot use localhost url")
	// ErrNoLoopbackAddressAllowed defines an error when a user tries to use loopback address
	ErrNoLoopbackAddressAllowed = errors.New("no loopback address acceptable")
	// ErrUnsupportedJobConfig defines an error for a job type we do not support at the moment
	ErrUnsupportedJobConfig = errors.New("we do not support this job type")
	// ErrHTTPSOnlyURL defines an error where a non https url is being used for a ssl check
	ErrHTTPSOnlyURL = errors.New("you can only check ssl of a domain with https")
)

AllAuditLogOrderField contains all valid AuditLogOrderField values.

View Source
var (
	// ErrComputeNextRunInvalid is used to define an error when a weekly run cannot be
	// computed
	ErrComputeNextRunInvalid = errors.New("could not compute next run time in weekly cadence")
)
View Source
var ErrUnsupportedDataType = errors.New("unsupported aaguid format")

Functions

func BumpMajor

func BumpMajor(v string) (string, error)

BumpMajor increments the major version by 1 It resets the minor and patch versions to 0 For example if the version is v1.7.1 the new version will be v2.0.0 It resets the pre-release version to empty

func BumpMinor

func BumpMinor(v string) (string, error)

BumpMinor increments the minor version by 1 It resets the patch version to 0 For example if the version is v1.7.1 the new version will be v1.8.0 It resets the pre-release version to empty

func BumpPatch

func BumpPatch(v string) (string, error)

BumpPatch increments the patch version by 1 For example if the version is v1.7.1 the new version will be v1.7.2 If the version has a pre-release version, it clears the pre-release version

func SetPreRelease

func SetPreRelease(v string) (string, error)

SetPreRelease sets the pre-release version to "draft" For example if the version is v1.7.1 the new version will be v1.7.2-draft

func Sort

func Sort[T Sortable](items []T) []T

Sort a slice of Sortable items by their sort field

func ValidateIP

func ValidateIP(s string) error

ValidateIP takes in an ip address and checks if it is usable for a job runner node

func ValidateURL

func ValidateURL(s string) (string, error)

ValidateURL takes in url and makes sure it is a valid url - it must be https - it must not be localhost - it must not be a loopback address to our machine

func WithSSOAuthorizations

func WithSSOAuthorizations(ctx context.Context, auth *SSOAuthorizationMap) context.Context

WithSSOAuthorizations stores the SSOAuthorizations in the context

func WithVersionBumpContext

func WithVersionBumpContext(ctx context.Context, v *VersionBump) context.Context

WithVersionBumpContext adds the VersionBump to the context

func WithVersionBumpRequestContext

func WithVersionBumpRequestContext(ctx context.Context, v *VersionBump)

WithVersionBumpContext adds the VersionBump to the context

Types

type AAGUID

type AAGUID []byte

AAGUID is a custom type representing an authenticator attestation uuid.

func ToAAGUID

func ToAAGUID(b []byte) *AAGUID

func (AAGUID) MarshalGQL

func (a AAGUID) MarshalGQL(w io.Writer)

func (*AAGUID) Scan

func (a *AAGUID) Scan(value interface{}) error

func (AAGUID) String

func (a AAGUID) String() string

func (*AAGUID) UnmarshalGQL

func (a *AAGUID) UnmarshalGQL(v any) error

func (AAGUID) Value

func (a AAGUID) Value() (driver.Value, error)

type Address

type Address struct {
	// Line1 is the first line of the address
	Line1 string `json:"line1"`
	// Line2 is the second line of the address
	Line2 string `json:"line2"`
	// City is the city of the address
	City string `json:"city"`
	// State is the state of the address
	State string `json:"state"`
	// PostalCode is the postal code of the address
	PostalCode string `json:"postalCode"`
	// Country is the country of the address
	Country string `json:"country"`
}

Address is a custom type for Address

func (Address) MarshalGQL

func (a Address) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Address) String

func (a Address) String() string

String returns a string representation of the address

func (*Address) UnmarshalGQL

func (a *Address) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type AssessmentMethod

type AssessmentMethod struct {
	// ID is the unique identifier for the assessment method
	ID string `json:"id,omitempty"`
	// Type is the type of assessment being performed, e.g. Interview, Test, etc.
	Type string `json:"type,omitempty"`
	// Method is the associated language describing the assessment method
	Method string `json:"method,omitempty"`
}

AssessmentMethod are methods that can be used during the audit to assess the control implementation

func (AssessmentMethod) GetSortField

func (a AssessmentMethod) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (AssessmentMethod) MarshalGQL

func (a AssessmentMethod) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*AssessmentMethod) UnmarshalGQL

func (a *AssessmentMethod) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type AssessmentObjective

type AssessmentObjective struct {
	// Class is the class of the assessment objective which is typically what framework it origins from
	Class string `json:"class,omitempty"`
	// ID is the unique identifier for the assessment objective
	ID string `json:"id,omitempty"`
	// Objective is the associated language describing the assessment objective
	Objective string `json:"objective,omitempty" `
}

AssessmentObjective are objectives that are validated during the audit to ensure the control is implemented

func (AssessmentObjective) GetSortField

func (a AssessmentObjective) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (AssessmentObjective) MarshalGQL

func (a AssessmentObjective) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*AssessmentObjective) UnmarshalGQL

func (a *AssessmentObjective) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type AuditLogOrderField

type AuditLogOrderField string

Properties by which AuditLog connections can be ordered.

const (
	AuditLogOrderFieldHistoryTime AuditLogOrderField = "history_time"
)

func (AuditLogOrderField) IsValid

func (e AuditLogOrderField) IsValid() bool

IsValid checks if the AuditLogOrderField is valid.

func (AuditLogOrderField) MarshalGQL

func (e AuditLogOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (AuditLogOrderField) MarshalJSON

func (e AuditLogOrderField) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for AuditLogOrderField.

func (AuditLogOrderField) String

func (e AuditLogOrderField) String() string

String returns the string representation of the AuditLogOrderField.

func (*AuditLogOrderField) UnmarshalGQL

func (e *AuditLogOrderField) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

func (*AuditLogOrderField) UnmarshalJSON

func (e *AuditLogOrderField) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AuditLogOrderField.

type Billing

type Billing struct {
	// Prices is a list of price options for the feature, each with its own billing interval and amount
	Prices []ItemPrice `json:"prices" yaml:"prices" jsonschema:"description=List of price options for this feature"`
}

Billing contains one or more price options for a module or addon

type Catalog

type Catalog struct {
	// Version is the version of the catalog, following semantic versioning
	// It is used to track changes and updates to the catalog structure and content.
	// Example: "1.0.0", "2.3.1"
	Version string `json:"version" yaml:"version" jsonschema:"description=Catalog version,example=1.0.0"`
	// SHA is the SHA256 hash of the catalog version string, used to verify integrity
	SHA string `json:"sha" yaml:"sha" jsonschema:"description=SHA of the catalog version"`
	// Modules is a set of purchasable modules available in the catalog
	// Each module has its own set of features, pricing, and audience targeting.
	// Example: "compliance", "reporting", "analytics"
	Modules FeatureSet `json:"modules" yaml:"modules" jsonschema:"description=Set of modules available in the catalog"`
	// Addons is a set of purchasable addons available in the catalog
	Addons FeatureSet `json:"addons" yaml:"addons" jsonschema:"description=Set of addons available in the catalog"`
}

Catalog contains all modules and addons offered by Openlane

type Change

type Change struct {
	// FieldName is the name of the field that changed.
	FieldName string
	// Old is the old value of the field.
	Old any
	// New is the new value of the field.
	New any
}

Change represents a change in an entity's field.

func (Change) MarshalGQL

func (c Change) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (*Change) UnmarshalGQL

func (c *Change) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type CredentialSet

type CredentialSet struct {
	// AccessKeyID for cloud providers
	AccessKeyID string `json:"accessKeyID"`
	// SecretAccessKey for cloud providers
	SecretAccessKey string `json:"secretAccessKey"`
	// ProjectID for GCS
	ProjectID string `json:"projectID"`
	// AccountID for Cloudflare R2
	AccountID string `json:"accountID"`
	// APIToken for Cloudflare R2
	APIToken string `json:"apiToken"`
	// ProviderData stores provider-specific metadata or attributes
	ProviderData map[string]any `json:"providerData,omitempty"`
	// OAuthAccessToken holds the OAuth access token when applicable
	OAuthAccessToken string `json:"oauthAccessToken,omitempty"`
	// OAuthRefreshToken holds the OAuth refresh token when applicable
	OAuthRefreshToken string `json:"oauthRefreshToken,omitempty"`
	// OAuthTokenType stores the OAuth token type (e.g., Bearer)
	OAuthTokenType string `json:"oauthTokenType,omitempty"`
	// OAuthExpiry stores the token expiry timestamp
	OAuthExpiry *time.Time `json:"oauthExpiry,omitempty"`
	// Claims stores serialized ID token claims if available
	Claims map[string]any `json:"claims,omitempty"`
}

CredentialSet is a custom type for pricing data

func (CredentialSet) MarshalGQL

func (c CredentialSet) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (CredentialSet) String

func (c CredentialSet) String() string

String returns a string representation of the CredentialSet with sensitive fields masked for logging

func (*CredentialSet) UnmarshalGQL

func (c *CredentialSet) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type Cron

type Cron string

Cron defines the syntax for the job execution

func (Cron) MarshalGQL

func (c Cron) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Cron) Next

func (c Cron) Next(from time.Time) (time.Time, error)

Next returns the next scheduled time after `from` based on the cron expression.

func (*Cron) Scan

func (c *Cron) Scan(value interface{}) error

func (Cron) String

func (c Cron) String() string

String returns a string representation of the cron

func (*Cron) UnmarshalGQL

func (c *Cron) UnmarshalGQL(v any) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (Cron) Validate

func (c Cron) Validate() error

Validate checks a cron to make sure it is valid . It also limits concurrent runs to 30 minutes interval of the last run so it parses the cron - look at next few executions and check the elapsed time

func (Cron) Value

func (c Cron) Value() (driver.Value, error)

Value returns human readable cron from the database

type DateTime

type DateTime time.Time

DateTime is a custom GraphQL scalar that converts to/from time.Time

func ToDateTime

func ToDateTime(s string) (*DateTime, error)

ToDateTime converts a string to a DateTime pointer. It accepts both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ" formats. Returns an error if the string is empty or in an invalid format.

func (DateTime) IsZero

func (d DateTime) IsZero() bool

IsZero checks if the DateTime is zero (equivalent to time.Time.IsZero)

func (DateTime) MarshalGQL

func (d DateTime) MarshalGQL(w io.Writer)

MarshalGQL writes the datetime as "YYYY-MM-DD"

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() ([]byte, error)

MarshalJSON formats the DateTime as a JSON string

func (DateTime) MarshalText

func (d DateTime) MarshalText() ([]byte, error)

MarshalText formats the DateTime as "YYYY-MM-DD" for text representation this function is used by the cursor pagination to correctly format the date into the cursor string

func (*DateTime) Scan

func (d *DateTime) Scan(value interface{}) error

Scan implements the sql.Scanner interface for DateTime

func (DateTime) String

func (d DateTime) String() string

String formats the given datetime into a human readable version

func (*DateTime) UnmarshalCSV

func (d *DateTime) UnmarshalCSV(s string) error

UnmarshalCSV allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"

func (*DateTime) UnmarshalGQL

func (d *DateTime) UnmarshalGQL(v any) error

UnmarshalGQL allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(b []byte) error

UnmarshalJSON parses the DateTime from a JSON string it accepts both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ" formats and returns an error if the format is invalid

func (*DateTime) UnmarshalText

func (d *DateTime) UnmarshalText(b []byte) error

UnmarshalText parses the DateTime from a byte slice this function is used by the cursor pagination to correctly parse the date from the cursor string

func (DateTime) Value

func (d DateTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface for DateTime

type Days

type Days []enums.JobWeekday

Days is used to provide a human readable version of weekdays

type EvidenceRequests

type EvidenceRequests struct {
	// EvidenceRequestID is the unique identifier for where the evidence requests were sourced from
	EvidenceRequestID string `json:"evidenceRequestID,omitempty"`
	// DocumentationArtifact is a description of the documentation you'd produce as evidence
	DocumentationArtifact string `json:"documentationArtifact,omitempty"`
	// ArtifactDescription is a description of the evidence artifact
	ArtifactDescription string `json:"artifactDescription,omitempty"`
	// AreaOfFocus is the area of focus for the evidence request
	AreaOfFocus string `json:"areaOfFocus,omitempty"`
}

EvidenceRequests are common evidence requests typically collected to demonstrate control implementation

func (EvidenceRequests) GetSortField

func (e EvidenceRequests) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (EvidenceRequests) MarshalGQL

func (e EvidenceRequests) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*EvidenceRequests) UnmarshalGQL

func (e *EvidenceRequests) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type ExampleEvidence

type ExampleEvidence struct {
	// DocumentationType is the documentation artifact type for the example evidence
	DocumentationType string `json:"documentationType,omitempty"`
	// Description is the description of the example documentation artifact for the evidence
	Description string `json:"description,omitempty"`
}

ExampleEvidence is example evidence that can be used to satisfy the control

func (ExampleEvidence) GetSortField

func (e ExampleEvidence) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (ExampleEvidence) MarshalGQL

func (e ExampleEvidence) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*ExampleEvidence) UnmarshalGQL

func (e *ExampleEvidence) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type Feature

type Feature struct {
	// DisplayName is the human-readable name for the feature
	DisplayName string `` /* 127-byte string literal not displayed */
	// LookupKey is a stable identifier for the feature, used for referencing in Stripe
	// and other systems. It should be lowercase, alphanumeric, and can include underscores or dashes.
	// Example: "compliance", "advanced_reporting"
	// Pattern: ^[a-z0-9_-]+$
	LookupKey string `` /* 155-byte string literal not displayed */
	// Description provides additional context about the feature
	Description string `` /* 171-byte string literal not displayed */
	// MarketingDescription is a longer description of the feature used for marketing material
	MarketingDescription string `` /* 263-byte string literal not displayed */
	// Billing contains the pricing information for the feature
	Billing Billing `json:"billing" yaml:"billing" jsonschema:"description=Billing information for the feature"`
	// Audience indicates the intended audience for the feature - it can either be "public", "private", or "beta".
	// - "public" features are available to all users
	// - "private" features are restricted to specific users or organizations
	// - "beta" features are in testing and may not be fully stable
	Audience string `` /* 140-byte string literal not displayed */
	// Usage defines the usage limits granted by the feature, such as storage or record counts
	Usage *Usage `json:"usage,omitempty" yaml:"usage,omitempty" jsonschema:"description=Usage limits granted by the feature"`
	// ProductID is the Stripe product ID associated with this feature
	ProductID string `json:"product_id,omitempty" yaml:"product_id,omitempty" jsonschema:"description=Stripe product ID"`
	// PersonalOrg indicates if the feature should be automatically added to personal organizations
	PersonalOrg bool `` /* 126-byte string literal not displayed */
	// IncludeWithTrial indicates if the feature should be automatically included with trial subscriptions
	IncludeWithTrial bool `` /* 137-byte string literal not displayed */
}

Feature defines a purchasable module or addon feature

type FeatureSet

type FeatureSet map[string]Feature

FeatureSet is a mapping of feature identifiers to metadata

type ImplementationGuidance

type ImplementationGuidance struct {
	// ReferenceID is the unique identifier for where the guidance was sourced from
	ReferenceID string `json:"referenceId,omitempty"`
	// Guidance are the steps to take to implement the control
	Guidance []string `json:"guidance,omitempty"`
}

ImplementationGuidance is the steps to take to implement the control they can come directly from the control source or pulled from external sources if the reference id matches the control ref code, the guidance is directly from the control if the reference id is different, the guidance is from an external source

func (ImplementationGuidance) GetSortField

func (i ImplementationGuidance) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (ImplementationGuidance) MarshalGQL

func (i ImplementationGuidance) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*ImplementationGuidance) UnmarshalGQL

func (i *ImplementationGuidance) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type ItemPrice

type ItemPrice struct {
	Interval   string            `json:"interval" yaml:"interval" jsonschema:"enum=year,enum=month,description=Billing interval for the price,example=month"`
	UnitAmount int64             `json:"unit_amount" yaml:"unit_amount" jsonschema:"description=Amount to be charged per interval,example=1000"`
	Nickname   string            `` /* 141-byte string literal not displayed */
	LookupKey  string            `` /* 180-byte string literal not displayed */
	Metadata   map[string]string `` /* 141-byte string literal not displayed */
	PriceID    string            `json:"price_id,omitempty" yaml:"price_id,omitempty" jsonschema:"description=Stripe price ID,example=price_1N2Yw2A1b2c3d4e5"`
}

ItemPrice describes a single price option for a module or addon

type JobCadence

type JobCadence struct {
	Days      Days                      `json:"days,omitempty"`
	Time      string                    `json:"time,omitempty"`
	Frequency enums.JobCadenceFrequency `json:"frequency,omitempty"`
}

JobCadence defines the logic for the execution of a job

func (JobCadence) IsZero

func (c JobCadence) IsZero() bool

IsZero checks if the cadence is not set yet

func (JobCadence) MarshalGQL

func (c JobCadence) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (JobCadence) Next

func (c JobCadence) Next(from time.Time) (time.Time, error)

Next calculates the next execution time for a JobCadence

func (JobCadence) String

func (c JobCadence) String() string

String marshals the cadence into a human readable version

func (*JobCadence) UnmarshalGQL

func (c *JobCadence) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (*JobCadence) Validate

func (c *JobCadence) Validate() error

Validate makes sure we have a usable job cadence setting

type JobConfiguration

type JobConfiguration json.RawMessage

JobConfiguration allows users configure the parameters that will be templated into their scripts that runs in the automated jobs

func (JobConfiguration) MarshalGQL

func (job JobConfiguration) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (JobConfiguration) MarshalJSON

func (job JobConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*JobConfiguration) UnmarshalGQL

func (job *JobConfiguration) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (*JobConfiguration) UnmarshalJSON

func (job *JobConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type OrgModule

type OrgModule string

OrgModule identifies a purchasable module

const (
	CatalogBaseModule                    OrgModule = "base_module"
	CatalogComplianceModule              OrgModule = "compliance_module"
	CatalogDomainScanningAddon           OrgModule = "domain_scanning_addon"
	CatalogEntityManagementModule        OrgModule = "entity_management_module"
	CatalogExtraEvidenceStorageAddon     OrgModule = "extra_evidence_storage_addon"
	CatalogPolicyManagementAddon         OrgModule = "policy_management_addon"
	CatalogRiskManagementAddon           OrgModule = "risk_management_addon"
	CatalogTrustCenterModule             OrgModule = "trust_center_module"
	CatalogVulnerabilityManagementModule OrgModule = "vulnerability_management_module"
)

func (OrgModule) IsValid

func (m OrgModule) IsValid() bool

IsValid reports whether m is a known module constant

func (OrgModule) MarshalGQL

func (m OrgModule) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (OrgModule) MarshalText

func (m OrgModule) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (OrgModule) String

func (m OrgModule) String() string

String returns the string representation of the OrgModule

func (*OrgModule) UnmarshalGQL

func (m *OrgModule) UnmarshalGQL(v any) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*OrgModule) UnmarshalText

func (m *OrgModule) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type Price

type Price struct {
	// Amount is the dollar amount of the price (e.g 100)
	Amount float64 `json:"amount"`
	// Interval is the interval of the price (e.g monthly, yearly)
	Interval string `json:"interval"`
	// Currency is the currency of the price that is being charged (e.g USD)
	Currency string `json:"currency"`
}

Price is a custom type for pricing data

func (Price) MarshalGQL

func (p Price) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Price) String

func (p Price) String() string

String returns a string representation of the price

func (*Price) UnmarshalGQL

func (p *Price) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type Reference

type Reference struct {
	// Name is the name of the reference
	Name string `json:"name,omitempty"`
	// URL is the link to the reference
	URL string `json:"url,omitempty"`
}

Reference are links to external sources that can be used to gain more information about the control

func (Reference) GetSortField

func (r Reference) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (Reference) MarshalGQL

func (r Reference) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*Reference) UnmarshalGQL

func (r *Reference) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type SSOAuthorizationMap

type SSOAuthorizationMap map[string]time.Time

SSOAuthorizationMap tracks SSO verification timestamps per organization ID.

func SSOAuthorizationsFromContext

func SSOAuthorizationsFromContext(ctx context.Context) (*SSOAuthorizationMap, bool)

SSOAuthorizationsFromContext retrieves SSOAuthorizations from the context

func (SSOAuthorizationMap) MarshalGQL

func (m SSOAuthorizationMap) MarshalGQL(w io.Writer)

MarshalGQL implements the gqlgen Marshaler interface.

func (*SSOAuthorizationMap) UnmarshalGQL

func (m *SSOAuthorizationMap) UnmarshalGQL(v any) error

UnmarshalGQL implements the gqlgen Unmarshaler interface.

type SearchContext

type SearchContext struct {
	EntityID      string           `json:"entityID"`
	EntityType    string           `json:"entityType"`
	MatchedFields []string         `json:"matchedFields"`
	Snippets      []*SearchSnippet `json:"snippets,omitempty"`
}

SearchContext provides information about why a particular entity matched the search query

type SearchSnippet

type SearchSnippet struct {
	Field string `json:"field"`
	Text  string `json:"text"`
}

SearchSnippet represents a piece of matched content with surrounding context

type SemverVersion

type SemverVersion struct {
	// Major is the major version
	Major int `json:"major,omitempty"`
	// Minor is the minor version
	Minor int `json:"minor,omitempty"`
	// Patch is the patch version
	Patch int `json:"patch,omitempty"`
	// PreRelease is the pre-release version (used for draft versions)
	PreRelease string `json:"preRelease,omitempty"`
}

SemverVersion is a custom type for semantic versioning It is used to represent the version of objects stored in the database

func ToSemverVersion

func ToSemverVersion(version *string) (*SemverVersion, error)

ToSemverVersion converts a string to a SemverVersion It parses the string and returns a SemverVersion object It supports the following formats: - v1.0.0 - 1.0.0 - v1.0.0-alpha - 1.0.0-alpha anything after the first "-" is considered a pre-release version

func (*SemverVersion) BumpPatchSemver

func (s *SemverVersion) BumpPatchSemver()

BumpPatch increments the patch version by 1 For example if the version is v1.7.1 the new version will be v1.7.2 It resets the pre-release version to empty

func (SemverVersion) String

func (s SemverVersion) String() string

String returns a string representation of the version

type Sortable

type Sortable interface {
	GetSortField() string
}

type TestingProcedures

type TestingProcedures struct {
	// ReferenceID is the unique identifier for where the procedures were sourced from
	ReferenceID string `json:"referenceId,omitempty"`
	// Procedures are the steps to take to test the control
	Procedures []string `json:"procedures,omitempty"`
}

TestingProcedures are the steps to take to test the control implementation and are typically a part of enriched data sources

func (TestingProcedures) GetSortField

func (t TestingProcedures) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (TestingProcedures) MarshalGQL

func (t TestingProcedures) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*TestingProcedures) UnmarshalGQL

func (t *TestingProcedures) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type Usage

type Usage struct {
	// EvidenceStorageGB is the storage limit in GB for evidence related to the feature
	EvidenceStorageGB int64 `` /* 142-byte string literal not displayed */
	// RecordCount is the maximum number of records allowed for the feature
	RecordCount int64 `` /* 131-byte string literal not displayed */
}

Usage defines usage limits granted by a feature.

type VersionBump

type VersionBump string

VersionBump is a custom type for version bumping It is used to represent the type of version bumping

var (
	// Major is the major version
	Major VersionBump = "MAJOR"
	// Minor is the minor version
	Minor VersionBump = "MINOR"
	// Patch is the patch version
	Patch VersionBump = "PATCH"
	// PreRelease is the pre-release version
	PreRelease VersionBump = "DRAFT"
)

func ToVersionBump

func ToVersionBump(r string) *VersionBump

ToVersionBump returns the version bump enum based on string input

func VersionBumpFromContext

func VersionBumpFromContext(ctx context.Context) (*VersionBump, bool)

VersionBumpFromContext returns the VersionBump from the context

func VersionBumpFromRequestContext

func VersionBumpFromRequestContext(ctx context.Context) (*VersionBump, bool)

VersionBumpFromContext returns the VersionBump from the context

func (VersionBump) MarshalGQL

func (v VersionBump) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (VersionBump) String

func (v VersionBump) String() string

String returns the role as a string

func (*VersionBump) UnmarshalGQL

func (v *VersionBump) UnmarshalGQL(a any) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (VersionBump) Values

func (VersionBump) Values() (kinds []string)

Values returns a slice of strings that represents all the possible values of the VersionBump enum. Possible default values are "MAJOR", "MINOR", "PATCH", "DRAFT"

type WorkflowAction

type WorkflowAction struct {
	Key         string          `json:"key,omitempty"`    // unique key within the workflow
	Type        string          `json:"type,omitempty"`   // action type, e.g. REQUEST_APPROVAL, NOTIFY
	Params      json.RawMessage `json:"params,omitempty"` // opaque config for the action
	When        string          `json:"when,omitempty"`   // optional CEL expression to conditionally execute this action
	Description string          `json:"description,omitempty"`
}

WorkflowAction represents an action performed by the workflow.

type WorkflowAssignmentContext

type WorkflowAssignmentContext struct {
	AssignmentKey string                         `json:"assignmentKey,omitempty"`
	Status        enums.WorkflowAssignmentStatus `json:"status,omitempty"`
	ActorUserID   string                         `json:"actorUserId,omitempty"`
	ActorGroupID  string                         `json:"actorGroupId,omitempty"`
	DecidedAt     *time.Time                     `json:"decidedAt,omitempty"`
	Notes         string                         `json:"notes,omitempty"`
}

WorkflowAssignmentContext tracks an assignment decision within an instance.

type WorkflowCondition

type WorkflowCondition struct {
	Expression  string `json:"expression,omitempty"`
	Description string `json:"description,omitempty"`
}

WorkflowCondition describes a CEL condition that must pass.

type WorkflowDefinitionDocument

type WorkflowDefinitionDocument struct {
	Name         string             `json:"name,omitempty"`
	Description  string             `json:"description,omitempty"`
	SchemaType   string             `json:"schemaType,omitempty"`
	WorkflowKind enums.WorkflowKind `json:"workflowKind,omitempty"`
	// ApprovalSubmissionMode controls draft vs auto-submit behavior for approval domains.
	ApprovalSubmissionMode enums.WorkflowApprovalSubmissionMode `json:"approvalSubmissionMode,omitempty"`
	Version                string                               `json:"version,omitempty"`
	Targets                WorkflowSelector                     `json:"targets,omitempty"`
	Triggers               []WorkflowTrigger                    `json:"triggers,omitempty"`
	Conditions             []WorkflowCondition                  `json:"conditions,omitempty"`
	Actions                []WorkflowAction                     `json:"actions,omitempty"`
	Metadata               map[string]any                       `json:"metadata,omitempty"`
}

WorkflowDefinitionDocument represents the stored workflow definition with typed fields.

func (WorkflowDefinitionDocument) MarshalGQL

func (d WorkflowDefinitionDocument) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowDefinitionDocument) UnmarshalGQL

func (d *WorkflowDefinitionDocument) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowDefinitionSchema

type WorkflowDefinitionSchema struct {
	Version string          `json:"version,omitempty"`
	Schema  json.RawMessage `json:"schema,omitempty"` // optional JSONSchema for validation
}

WorkflowDefinitionSchema represents a template schema for definitions.

func (WorkflowDefinitionSchema) MarshalGQL

func (d WorkflowDefinitionSchema) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowDefinitionSchema) UnmarshalGQL

func (d *WorkflowDefinitionSchema) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowEventPayload

type WorkflowEventPayload struct {
	EventType enums.WorkflowEventType `json:"eventType,omitempty"`
	ActionKey string                  `json:"actionKey,omitempty"`
	Details   json.RawMessage         `json:"details,omitempty"`
}

WorkflowEventPayload stores workflow event payloads.

func (WorkflowEventPayload) MarshalGQL

func (p WorkflowEventPayload) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowEventPayload) UnmarshalGQL

func (p *WorkflowEventPayload) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowInstanceContext

type WorkflowInstanceContext struct {
	WorkflowDefinitionID string                      `json:"workflowDefinitionId,omitempty"`
	ObjectType           enums.WorkflowObjectType    `json:"objectType,omitempty"`
	ObjectID             string                      `json:"objectId,omitempty"`
	Version              int                         `json:"version,omitempty"`
	Assignments          []WorkflowAssignmentContext `json:"assignments,omitempty"`
	TriggerEventType     string                      `json:"triggerEventType,omitempty"`
	TriggerChangedFields []string                    `json:"triggerChangedFields,omitempty"`
	TriggerChangedEdges  []string                    `json:"triggerChangedEdges,omitempty"`
	TriggerAddedIDs      map[string][]string         `json:"triggerAddedIds,omitempty"`
	TriggerRemovedIDs    map[string][]string         `json:"triggerRemovedIds,omitempty"`
	TriggerUserID        string                      `json:"triggerUserId,omitempty"`
	Data                 json.RawMessage             `json:"data,omitempty"` // optional payload captured at runtime
}

WorkflowInstanceContext holds runtime context for a workflow instance.

func (WorkflowInstanceContext) MarshalGQL

func (c WorkflowInstanceContext) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowInstanceContext) UnmarshalGQL

func (c *WorkflowInstanceContext) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowSelector

type WorkflowSelector struct {
	TagIDs      []string                   `json:"tagIds,omitempty"`
	GroupIDs    []string                   `json:"groupIds,omitempty"`
	ObjectTypes []enums.WorkflowObjectType `json:"objectTypes,omitempty"`
}

WorkflowSelector scopes workflows to tags, groups, or object types.

type WorkflowTrigger

type WorkflowTrigger struct {
	Operation   string                   `json:"operation,omitempty"`   // e.g. CREATE, UPDATE, DELETE
	ObjectType  enums.WorkflowObjectType `json:"objectType,omitempty"`  // schema/object type the trigger targets
	Fields      []string                 `json:"fields,omitempty"`      // specific fields that should trigger evaluation
	Edges       []string                 `json:"edges,omitempty"`       // specific edges (relationships) that should trigger evaluation
	Selector    WorkflowSelector         `json:"selector,omitempty"`    // scoping for tags/groups/objects
	Expression  string                   `json:"expression,omitempty"`  // optional CEL expression
	Description string                   `json:"description,omitempty"` // human friendly description
}

WorkflowTrigger describes when to run a workflow.

Jump to

Keyboard shortcuts

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