fix: add involves edge from task to agent:nomos at creation
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

Plus sync vendor directory for Docker build compatibility.
This commit is contained in:
2026-08-11 22:03:12 +02:00
parent 7d6a3320d4
commit febc153b7f
3384 changed files with 945212 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
package api
import (
"github.com/go-resty/resty/v2"
"github.com/infisical/go-sdk/packages/errors"
)
const callBatchCreateSecretV3RawOperation = "CallBatchCreateSecretV3Raw"
func CallBatchCreateSecretV3(httpClient *resty.Client, request BatchCreateSecretsV3RawRequest) (BatchCreateSecretsV3RawResponse, error) {
createBatchResponse := BatchCreateSecretsV3RawResponse{}
req := httpClient.R().
SetResult(&createBatchResponse).
SetBody(request)
res, err := req.Post("/v3/secrets/batch/raw")
if err != nil {
return BatchCreateSecretsV3RawResponse{}, errors.NewRequestError(callBatchCreateSecretV3RawOperation, err)
}
if res.IsError() {
return BatchCreateSecretsV3RawResponse{}, errors.NewAPIErrorWithResponse(callBatchCreateSecretV3RawOperation, res)
}
for idx := range createBatchResponse.Secrets {
secretPath := request.SecretPath
if secretPath == "" {
secretPath = "/"
}
createBatchResponse.Secrets[idx].SecretPath = secretPath
}
return createBatchResponse, nil
}

View File

@@ -0,0 +1,31 @@
package api
import (
"fmt"
"github.com/go-resty/resty/v2"
"github.com/infisical/go-sdk/packages/errors"
)
const callCreateSecretV3RawOperation = "CallCreateSecretV3Raw"
func CallCreateSecretV3(httpClient *resty.Client, request CreateSecretV3RawRequest) (CreateSecretV3RawResponse, error) {
createResponse := CreateSecretV3RawResponse{}
req := httpClient.R().
SetResult(&createResponse).
SetBody(request)
res, err := req.Post(fmt.Sprintf("/v3/secrets/raw/%s", request.SecretKey))
if err != nil {
return CreateSecretV3RawResponse{}, errors.NewRequestError(callCreateSecretV3RawOperation, err)
}
if res.IsError() {
return CreateSecretV3RawResponse{}, errors.NewAPIErrorWithResponse(callCreateSecretV3RawOperation, res)
}
return createResponse, nil
}

View File

@@ -0,0 +1,31 @@
package api
import (
"fmt"
"github.com/go-resty/resty/v2"
"github.com/infisical/go-sdk/packages/errors"
)
const callDeleteSecretV3RawOperation = "CallDeleteSecretV3Raw"
func CallDeleteSecretV3(httpClient *resty.Client, request DeleteSecretV3RawRequest) (DeleteSecretV3RawResponse, error) {
deleteResponse := DeleteSecretV3RawResponse{}
req := httpClient.R().
SetResult(&deleteResponse).
SetBody(request)
res, err := req.Delete(fmt.Sprintf("/v3/secrets/raw/%s", request.SecretKey))
if err != nil {
return DeleteSecretV3RawResponse{}, errors.NewRequestError(callDeleteSecretV3RawOperation, err)
}
if res.IsError() {
return DeleteSecretV3RawResponse{}, errors.NewAPIErrorWithResponse(callDeleteSecretV3RawOperation, res)
}
return deleteResponse, nil
}

View File

@@ -0,0 +1,75 @@
package api
import (
"encoding/json"
"fmt"
"github.com/go-resty/resty/v2"
"github.com/hashicorp/golang-lru/v2/expirable"
"github.com/infisical/go-sdk/packages/errors"
"github.com/infisical/go-sdk/packages/util"
)
const callListSecretsV3RawOperation = "CallListSecretsV3Raw"
func CallListSecretsV3(cache *expirable.LRU[string, interface{}], httpClient *resty.Client, request ListSecretsV3RawRequest) (ListSecretsV3RawResponse, error) {
var cacheKey string
if cache != nil {
reqBytes, err := json.Marshal(request)
if err != nil {
return ListSecretsV3RawResponse{}, err
}
cacheKey = util.ComputeCacheKeyFromBytes(reqBytes, callListSecretsV3RawOperation)
if cached, found := cache.Get(cacheKey); found {
if response, ok := cached.(ListSecretsV3RawResponse); ok {
return response, nil
}
cache.Remove(cacheKey)
}
}
secretsResponse := ListSecretsV3RawResponse{}
if request.SecretPath == "" {
request.SecretPath = "/"
}
req := httpClient.R().
SetResult(&secretsResponse).
SetQueryParams(map[string]string{
"workspaceId": request.ProjectID,
"workspaceSlug": request.ProjectSlug,
"environment": request.Environment,
"secretPath": request.SecretPath,
"expandSecretReferences": fmt.Sprintf("%t", request.ExpandSecretReferences),
"include_imports": fmt.Sprintf("%t", request.IncludeImports),
"recursive": fmt.Sprintf("%t", request.Recursive),
})
if request.IfNoneMatch != "" {
req.SetHeader("If-None-Match", request.IfNoneMatch)
}
res, err := req.Get("/v3/secrets/raw")
if err != nil {
return ListSecretsV3RawResponse{}, errors.NewRequestError(callListSecretsV3RawOperation, err)
}
if res.StatusCode() == 304 {
return ListSecretsV3RawResponse{}, errors.NewNotModifiedError(callListSecretsV3RawOperation)
}
if res.IsError() {
return ListSecretsV3RawResponse{}, errors.NewAPIErrorWithResponse(callListSecretsV3RawOperation, res)
}
secretsResponse.ETag = res.Header().Get("ETag")
if cache != nil {
cache.Add(cacheKey, secretsResponse)
}
return secretsResponse, nil
}

View File

@@ -0,0 +1,113 @@
package api
import "github.com/infisical/go-sdk/packages/models"
// List secrets
type ListSecretsV3RawRequest struct {
AttachToProcessEnv bool `json:"-"`
// ProjectId and ProjectSlug are used to fetch secrets from the project. Only one of them is required.
ProjectID string `json:"workspaceId,omitempty"`
ProjectSlug string `json:"workspaceSlug,omitempty"`
Environment string `json:"environment"`
ExpandSecretReferences bool `json:"expandSecretReferences"`
IncludeImports bool `json:"include_imports"`
Recursive bool `json:"recursive"`
SecretPath string `json:"secretPath,omitempty"`
SkipUniqueValidation bool `json:"skip_unique_validation,omitempty"`
IfNoneMatch string `json:"-"`
}
type ListSecretsV3RawResponse struct {
Secrets []models.Secret `json:"secrets"`
Imports []models.SecretImport `json:"imports"`
ETag string `json:"etag"`
}
// Retrieve secret
type RetrieveSecretV3RawRequest struct {
SecretKey string `json:"secretKey"`
ProjectSlug string `json:"workspaceSlug,omitempty"`
ProjectID string `json:"workspaceId,omitempty"`
Environment string `json:"environment"`
SecretPath string `json:"secretPath,omitempty"`
Type string `json:"type,omitempty"`
IncludeImports bool `json:"include_imports"`
ExpandSecretReferences bool `json:"expandSecretReferences"`
Version int `json:"version,omitempty"`
}
type RetrieveSecretV3RawResponse struct {
Secret models.Secret `json:"secret"`
}
// Update secret
type UpdateSecretV3RawRequest struct {
SecretKey string `json:"-"`
ProjectID string `json:"workspaceId"`
Environment string `json:"environment"`
SecretPath string `json:"secretPath,omitempty"`
Type string `json:"type,omitempty"`
NewSecretValue string `json:"secretValue,omitempty"`
NewSkipMultilineEncoding bool `json:"skipMultilineEncoding,omitempty"`
}
type UpdateSecretV3RawResponse struct {
Secret models.Secret `json:"secret"`
}
// Create secret
type CreateSecretV3RawRequest struct {
SecretKey string `json:"-"`
ProjectID string `json:"workspaceId"`
Environment string `json:"environment"`
SecretPath string `json:"secretPath,omitempty"`
Type string `json:"type,omitempty"`
SecretComment string `json:"secretComment,omitempty"`
SkipMultiLineEncoding bool `json:"skipMultilineEncoding"`
SecretValue string `json:"secretValue"`
}
type CreateSecretV3RawResponse struct {
Secret models.Secret `json:"secret"`
}
// Delete secret
type DeleteSecretV3RawRequest struct {
SecretKey string `json:"-"`
ProjectID string `json:"workspaceId"`
Environment string `json:"environment"`
SecretPath string `json:"secretPath,omitempty"`
Type string `json:"type,omitempty"`
}
type DeleteSecretV3RawResponse struct {
Secret models.Secret `json:"secret"`
}
type BatchCreateSecret struct {
SecretKey string `json:"secretKey"`
SecretValue string `json:"secretValue"`
SecretComment string `json:"secretComment,omitempty"`
SkipMultiLineEncoding bool `json:"skipMultilineEncoding,omitempty"`
SecretMetadata []models.SecretMetadata `json:"secretMetadata,omitempty"`
TagIDs []string `json:"tagIds,omitempty"`
}
type BatchCreateSecretsV3RawRequest struct {
Environment string `json:"environment"`
ProjectID string `json:"workspaceId"`
SecretPath string `json:"secretPath,omitempty"`
Secrets []BatchCreateSecret `json:"secrets"`
}
type BatchCreateSecretsV3RawResponse struct {
Secrets []models.Secret `json:"secrets"`
}

View File

@@ -0,0 +1,81 @@
package api
import (
"encoding/json"
"errors"
"fmt"
"github.com/go-resty/resty/v2"
"github.com/hashicorp/golang-lru/v2/expirable"
sdkErrors "github.com/infisical/go-sdk/packages/errors"
"github.com/infisical/go-sdk/packages/util"
)
const callRetrieveSecretV3RawOperation = "CallRetrieveSecretV3Raw"
func CallRetrieveSecretV3(cache *expirable.LRU[string, interface{}], httpClient *resty.Client, request RetrieveSecretV3RawRequest) (RetrieveSecretV3RawResponse, error) {
var cacheKey string
if cache != nil {
reqBytes, err := json.Marshal(request)
if err != nil {
return RetrieveSecretV3RawResponse{}, err
}
cacheKey = util.ComputeCacheKeyFromBytes(reqBytes, callRetrieveSecretV3RawOperation)
if cached, found := cache.Get(cacheKey); found {
if response, ok := cached.(RetrieveSecretV3RawResponse); ok {
return response, nil
}
cache.Remove(cacheKey)
}
}
retrieveResponse := RetrieveSecretV3RawResponse{}
if request.Type == "" {
request.Type = "shared"
}
if request.SecretPath == "" {
request.SecretPath = "/"
}
queryParams := map[string]string{
"environment": request.Environment,
"secretPath": request.SecretPath,
"expandSecretReferences": fmt.Sprintf("%t", request.ExpandSecretReferences),
"include_imports": fmt.Sprintf("%t", request.IncludeImports),
"type": request.Type,
}
if request.ProjectID != "" {
queryParams["workspaceId"] = request.ProjectID
} else if request.ProjectSlug != "" {
queryParams["workspaceSlug"] = request.ProjectSlug
} else {
return RetrieveSecretV3RawResponse{}, errors.New("projectId or projectSlug is required")
}
if request.Version != 0 {
queryParams["version"] = fmt.Sprintf("%d", request.Version)
}
req := httpClient.R().
SetResult(&retrieveResponse).
SetQueryParams(queryParams)
res, err := req.Get(fmt.Sprintf("/v3/secrets/raw/%s", request.SecretKey))
if err != nil {
return RetrieveSecretV3RawResponse{}, sdkErrors.NewRequestError(callRetrieveSecretV3RawOperation, err)
}
if res.IsError() {
return RetrieveSecretV3RawResponse{}, sdkErrors.NewAPIErrorWithResponse(callRetrieveSecretV3RawOperation, res)
}
if cache != nil {
cache.Add(cacheKey, retrieveResponse)
}
return retrieveResponse, nil
}

View File

@@ -0,0 +1,31 @@
package api
import (
"fmt"
"github.com/go-resty/resty/v2"
"github.com/infisical/go-sdk/packages/errors"
)
const callUpdateSecretV3RawOperation = "CallUpdateSecretV3Raw"
func CallUpdateSecretV3(httpClient *resty.Client, request UpdateSecretV3RawRequest) (UpdateSecretV3RawResponse, error) {
updateResponse := UpdateSecretV3RawResponse{}
req := httpClient.R().
SetResult(&updateResponse).
SetBody(request)
res, err := req.Patch(fmt.Sprintf("/v3/secrets/raw/%s", request.SecretKey))
if err != nil {
return UpdateSecretV3RawResponse{}, errors.NewRequestError(callUpdateSecretV3RawOperation, err)
}
if res.IsError() {
return UpdateSecretV3RawResponse{}, errors.NewAPIErrorWithResponse(callUpdateSecretV3RawOperation, res)
}
return updateResponse, nil
}