Documentation
¶
Overview ¶
Package models provides custom object definitions for the core api
Index ¶
- Constants
- Variables
- func BumpMajor(v string) (string, error)
- func BumpMinor(v string) (string, error)
- func BumpPatch(v string) (string, error)
- func SetPreRelease(v string) (string, error)
- func Sort[T Sortable](items []T) []T
- func ValidateIP(s string) error
- func ValidateURL(s string) (string, error)
- func WithSSOAuthorizations(ctx context.Context, auth *SSOAuthorizationMap) context.Context
- func WithVersionBumpContext(ctx context.Context, v *VersionBump) context.Context
- func WithVersionBumpRequestContext(ctx context.Context, v *VersionBump)
- type AAGUID
- type Address
- type AssessmentMethod
- type AssessmentObjective
- type AuditLogOrderField
- func (e AuditLogOrderField) IsValid() bool
- func (e AuditLogOrderField) MarshalGQL(w io.Writer)
- func (e AuditLogOrderField) MarshalJSON() ([]byte, error)
- func (e AuditLogOrderField) String() string
- func (e *AuditLogOrderField) UnmarshalGQL(v any) error
- func (e *AuditLogOrderField) UnmarshalJSON(b []byte) error
- type Billing
- type Catalog
- type Change
- type CredentialSet
- type Cron
- type DateTime
- func (d DateTime) IsZero() bool
- func (d DateTime) MarshalGQL(w io.Writer)
- func (d DateTime) MarshalJSON() ([]byte, error)
- func (d DateTime) MarshalText() ([]byte, error)
- func (d *DateTime) Scan(value interface{}) error
- func (d DateTime) String() string
- func (d *DateTime) UnmarshalCSV(s string) error
- func (d *DateTime) UnmarshalGQL(v any) error
- func (d *DateTime) UnmarshalJSON(b []byte) error
- func (d *DateTime) UnmarshalText(b []byte) error
- func (d DateTime) Value() (driver.Value, error)
- type Days
- type EvidenceRequests
- type ExampleEvidence
- type Feature
- type FeatureSet
- type ImplementationGuidance
- type ItemPrice
- type JobCadence
- type JobConfiguration
- type OrgModule
- type Price
- type Reference
- type SSOAuthorizationMap
- type SearchContext
- type SearchSnippet
- type SemverVersion
- type Sortable
- type TestingProcedures
- type Usage
- type VersionBump
- type WorkflowAction
- type WorkflowAssignmentContext
- type WorkflowCondition
- type WorkflowDefinitionDocument
- type WorkflowDefinitionSchema
- type WorkflowEventPayload
- type WorkflowInstanceContext
- type WorkflowSelector
- type WorkflowTrigger
Constants ¶
const (
// DefaultRevision is the default revision to be used for new records
DefaultRevision = "v0.0.1"
)
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 ¶
var ( ErrUnsupportedDateTimeType = errors.New("unsupported time format") ErrInvalidTimeType = errors.New("invalid date format, expected YYYY-MM-DD or full ISO8601") )
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") )
var AllAuditLogOrderField = []AuditLogOrderField{ AuditLogOrderFieldHistoryTime, }
AllAuditLogOrderField contains all valid AuditLogOrderField values.
var AllOrgModules = []OrgModule{CatalogBaseModule, CatalogComplianceModule, CatalogDomainScanningAddon, CatalogEntityManagementModule, CatalogExtraEvidenceStorageAddon, CatalogPolicyManagementAddon, CatalogRiskManagementAddon, CatalogTrustCenterModule, CatalogVulnerabilityManagementModule}
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") )
var ErrUnsupportedDataType = errors.New("unsupported aaguid format")
var TrialModules = []OrgModule{CatalogBaseModule, CatalogComplianceModule}
Functions ¶
func BumpMajor ¶
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 ¶
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 ¶
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 ¶
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 ValidateIP ¶
ValidateIP takes in an ip address and checks if it is usable for a job runner node
func ValidateURL ¶
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 (AAGUID) MarshalGQL ¶
func (*AAGUID) UnmarshalGQL ¶
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 ¶
MarshalGQL implement the Marshaler interface for gqlgen
func (*Address) UnmarshalGQL ¶
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 ¶
MarshalGQL implement the Marshaler interface for gqlgen
func (*Change) UnmarshalGQL ¶
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 ¶
MarshalGQL implement the Marshaler interface for gqlgen
func (*Cron) UnmarshalGQL ¶
UnmarshalGQL implement the Unmarshaler interface for gqlgen
type DateTime ¶
DateTime is a custom GraphQL scalar that converts to/from time.Time
func ToDateTime ¶
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) MarshalGQL ¶
MarshalGQL writes the datetime as "YYYY-MM-DD"
func (DateTime) MarshalJSON ¶
MarshalJSON formats the DateTime as a JSON string
func (DateTime) MarshalText ¶
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) UnmarshalCSV ¶
UnmarshalCSV allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"
func (*DateTime) UnmarshalGQL ¶
UnmarshalGQL allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"
func (*DateTime) UnmarshalJSON ¶
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 ¶
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
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 ¶
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) 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) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (OrgModule) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*OrgModule) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface
func (*OrgModule) UnmarshalText ¶
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 ¶
MarshalGQL implement the Marshaler interface for gqlgen
func (*Price) UnmarshalGQL ¶
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 ¶
GetSortField returns the field to sort on for the Sortable interface
func (Reference) MarshalGQL ¶
MarshalGQL implements the Marshaler interface for gqlgen
func (*Reference) UnmarshalGQL ¶
UnmarshalGQL implements the Unmarshaler interface for gqlgen
type SSOAuthorizationMap ¶
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 ¶
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 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.