diff --git a/client/telemetry/TelemetryEventClient.go b/client/telemetry/TelemetryEventClient.go
index 4d60e778c9..f32382a06b 100644
--- a/client/telemetry/TelemetryEventClient.go
+++ b/client/telemetry/TelemetryEventClient.go
@@ -78,6 +78,7 @@ type TelemetryEventClientImpl struct {
userAttributesRepository repository.UserAttributesRepository
cloudProviderIdentifierService cloudProviderIdentifier.ProviderIdentifierService
telemetryConfig TelemetryConfig
+ globalEnvVariables *util.GlobalEnvVariables
}
type TelemetryEventClient interface {
@@ -96,7 +97,8 @@ func NewTelemetryEventClientImpl(logger *zap.SugaredLogger, client *http.Client,
serverDataStore *serverDataStore.ServerDataStore, userAuditService user2.UserAuditService,
helmAppClient gRPC.HelmAppClient,
cloudProviderIdentifierService cloudProviderIdentifier.ProviderIdentifierService, cronLogger *cron3.CronLoggerImpl,
- installedAppReadService installedAppReader.InstalledAppReadServiceEA) (*TelemetryEventClientImpl, error) {
+ installedAppReadService installedAppReader.InstalledAppReadServiceEA,
+ envVariables *util.EnvironmentVariables) (*TelemetryEventClientImpl, error) {
cron := cron.New(
cron.WithChain(cron.Recover(cronLogger)))
cron.Start()
@@ -118,6 +120,7 @@ func NewTelemetryEventClientImpl(logger *zap.SugaredLogger, client *http.Client,
installedAppReadService: installedAppReadService,
cloudProviderIdentifierService: cloudProviderIdentifierService,
telemetryConfig: TelemetryConfig{},
+ globalEnvVariables: envVariables.GlobalEnvVariables,
}
watcher.HeartbeatEventForTelemetry()
@@ -423,7 +426,7 @@ func (impl *TelemetryEventClientImpl) EnqueueGenericPostHogEvent(ucid string, ev
impl.PosthogClient.Client = client
}
}
- if impl.PosthogClient.Client != nil {
+ if impl.PosthogClient.Client != nil && !impl.globalEnvVariables.IsAirGapEnvironment {
err := impl.PosthogClient.Client.Enqueue(posthog.Capture{
DistinctId: ucid,
Event: eventType,
diff --git a/cmd/external-app/wire.go b/cmd/external-app/wire.go
index 15b1aeae72..4d05bdbbda 100644
--- a/cmd/external-app/wire.go
+++ b/cmd/external-app/wire.go
@@ -97,7 +97,6 @@ import (
func InitializeApp() (*App, error) {
wire.Build(
user.SelfRegistrationWireSet,
-
sql.PgSqlWireSet,
user.UserWireSet,
sso.SsoConfigWireSet,
diff --git a/cmd/external-app/wire_gen.go b/cmd/external-app/wire_gen.go
index cc31476cbe..b0a26de083 100644
--- a/cmd/external-app/wire_gen.go
+++ b/cmd/external-app/wire_gen.go
@@ -389,7 +389,7 @@ func InitializeApp() (*App, error) {
return nil, err
}
providerIdentifierServiceImpl := providerIdentifier.NewProviderIdentifierServiceImpl(sugaredLogger)
- telemetryEventClientImpl, err := telemetry.NewTelemetryEventClientImpl(sugaredLogger, httpClient, clusterServiceImpl, k8sServiceImpl, acdAuthConfig, userServiceImpl, attributesRepositoryImpl, ssoLoginServiceImpl, posthogClient, moduleRepositoryImpl, serverDataStoreServerDataStore, userAuditServiceImpl, helmAppClientImpl, providerIdentifierServiceImpl, cronLoggerImpl, installedAppReadServiceEAImpl)
+ telemetryEventClientImpl, err := telemetry.NewTelemetryEventClientImpl(sugaredLogger, httpClient, clusterServiceImpl, k8sServiceImpl, acdAuthConfig, userServiceImpl, attributesRepositoryImpl, ssoLoginServiceImpl, posthogClient, moduleRepositoryImpl, serverDataStoreServerDataStore, userAuditServiceImpl, helmAppClientImpl, providerIdentifierServiceImpl, cronLoggerImpl, installedAppReadServiceEAImpl, environmentVariables)
if err != nil {
return nil, err
}
@@ -425,7 +425,7 @@ func InitializeApp() (*App, error) {
}
scanToolMetadataRepositoryImpl := repository11.NewScanToolMetadataRepositoryImpl(db, sugaredLogger)
scanToolMetadataServiceImpl := scanTool.NewScanToolMetadataServiceImpl(sugaredLogger, scanToolMetadataRepositoryImpl)
- moduleServiceImpl := module.NewModuleServiceImpl(sugaredLogger, serverEnvConfigServerEnvConfig, moduleRepositoryImpl, moduleActionAuditLogRepositoryImpl, helmAppServiceImpl, serverDataStoreServerDataStore, serverCacheServiceImpl, moduleCacheServiceImpl, moduleCronServiceImpl, moduleServiceHelperImpl, moduleResourceStatusRepositoryImpl, scanToolMetadataServiceImpl)
+ moduleServiceImpl := module.NewModuleServiceImpl(sugaredLogger, serverEnvConfigServerEnvConfig, moduleRepositoryImpl, moduleActionAuditLogRepositoryImpl, helmAppServiceImpl, serverDataStoreServerDataStore, serverCacheServiceImpl, moduleCacheServiceImpl, moduleCronServiceImpl, moduleServiceHelperImpl, moduleResourceStatusRepositoryImpl, scanToolMetadataServiceImpl, environmentVariables, moduleEnvConfig)
moduleRestHandlerImpl := module2.NewModuleRestHandlerImpl(sugaredLogger, moduleServiceImpl, userServiceImpl, enforcerImpl, validate)
moduleRouterImpl := module2.NewModuleRouterImpl(moduleRestHandlerImpl)
serverActionAuditLogRepositoryImpl := server.NewServerActionAuditLogRepositoryImpl(db)
diff --git a/env_gen.json b/env_gen.json
index 4c19b25379..b4b889fc79 100644
--- a/env_gen.json
+++ b/env_gen.json
@@ -1 +1 @@
-[{"Category":"CD","Fields":[{"Env":"ARGO_APP_MANUAL_SYNC_TIME","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_HELM_PIPELINE_STATUS_CRON_TIME","EnvType":"string","EnvValue":"*/2 * * * *","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_PIPELINE_STATUS_CRON_TIME","EnvType":"string","EnvValue":"*/2 * * * *","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_PIPELINE_STATUS_TIMEOUT_DURATION","EnvType":"string","EnvValue":"20","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEPLOY_STATUS_CRON_GET_PIPELINE_DEPLOYED_WITHIN_HOURS","EnvType":"int","EnvValue":"12","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_CHART_ARGO_CD_INSTALL_REQUEST_TIMEOUT","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_CHART_INSTALL_REQUEST_TIMEOUT","EnvType":"int","EnvValue":"6","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXPOSE_CD_METRICS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FEATURE_MIGRATE_ARGOCD_APPLICATION_ENABLE","EnvType":"bool","EnvValue":"false","EnvDescription":"enable migration of external argocd application to devtron pipeline","Example":"","Deprecated":"false"},{"Env":"HELM_PIPELINE_STATUS_CHECK_ELIGIBLE_TIME","EnvType":"string","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IS_INTERNAL_USE","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MIGRATE_DEPLOYMENT_CONFIG_DATA","EnvType":"bool","EnvValue":"false","EnvDescription":"migrate deployment config data from charts table to deployment_config table","Example":"","Deprecated":"false"},{"Env":"PIPELINE_DEGRADED_TIME","EnvType":"string","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_DEVTRON_APP","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_EXTERNAL_HELM_APP","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_HELM_APP","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_LINKED_HELM_APP","EnvType":"int","EnvValue":"15","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RUN_HELM_INSTALL_IN_ASYNC_MODE_HELM_APPS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SHOULD_CHECK_NAMESPACE_ON_CLONE","EnvType":"bool","EnvValue":"false","EnvDescription":"should we check if namespace exists or not while cloning app","Example":"","Deprecated":"false"},{"Env":"USE_DEPLOYMENT_CONFIG_DATA","EnvType":"bool","EnvValue":"false","EnvDescription":"use deployment config data from deployment_config table","Example":"","Deprecated":"true"}]},{"Category":"CI_RUNNER","Fields":[{"Env":"AZURE_ACCOUNT_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_ACCOUNT_NAME","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_CACHE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_LOG","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_CONNECTION_INSECURE","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_URL","EnvType":"string","EnvValue":"http://devtron-minio.devtroncd:9000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BASE_LOG_LOCATION_PATH","EnvType":"string","EnvValue":"/home/devtron/","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_GCP_CREDENTIALS_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_PROVIDER","EnvType":"","EnvValue":"S3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ACCESS_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_BUCKET_VERSIONED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT_INSECURE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_SECRET_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_CACHE_PATH","EnvType":"string","EnvValue":"/var/lib/devtron/buildx","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_K8S_DRIVER_OPTIONS","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_PROVENANCE_MODE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILD_LOG_TTL_VALUE_IN_SECS","EnvType":"int","EnvValue":"3600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CACHE_LIMIT","EnvType":"int64","EnvValue":"5000000000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_DEFAULT_ADDRESS_POOL_BASE_CIDR","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_DEFAULT_ADDRESS_POOL_SIZE","EnvType":"int","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_LIMIT_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_LIMIT_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NODE_LABEL_SELECTOR","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NODE_TAINTS_KEY","EnvType":"string","EnvValue":"dedicated","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NODE_TAINTS_VALUE","EnvType":"string","EnvValue":"ci","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_REQ_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_REQ_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_WORKFLOW_EXECUTOR_TYPE","EnvType":"","EnvValue":"AWF","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_WORKFLOW_SERVICE_ACCOUNT","EnvType":"string","EnvValue":"cd-runner","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_DEFAULT_ADDRESS_POOL_BASE_CIDR","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_DEFAULT_ADDRESS_POOL_SIZE","EnvType":"int","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_IGNORE_DOCKER_CACHE","EnvType":"bool","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_LOGS_KEY_PREFIX","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_NODE_LABEL_SELECTOR","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_NODE_TAINTS_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_NODE_TAINTS_VALUE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_RUNNER_DOCKER_MTU_VALUE","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_SUCCESS_AUTO_TRIGGER_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_VOLUME_MOUNTS_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_WORKFLOW_EXECUTOR_TYPE","EnvType":"","EnvValue":"AWF","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_ARTIFACT_KEY_LOCATION","EnvType":"string","EnvValue":"arsenal-v1/ci-artifacts","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_BUILD_LOGS_BUCKET","EnvType":"string","EnvValue":"devtron-pro-ci-logs","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_BUILD_LOGS_KEY_PREFIX","EnvType":"string","EnvValue":"arsenal-v1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET","EnvType":"string","EnvValue":"ci-caching","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET_REGION","EnvType":"string","EnvValue":"us-east-2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_ARTIFACT_KEY_LOCATION","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_LOGS_BUCKET_REGION","EnvType":"string","EnvValue":"us-east-2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_NAMESPACE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_TIMEOUT","EnvType":"int64","EnvValue":"3600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CI_IMAGE","EnvType":"string","EnvValue":"686244538589.dkr.ecr.us-east-2.amazonaws.com/cirunner:47","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_NAMESPACE","EnvType":"string","EnvValue":"devtron-ci","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_TARGET_PLATFORM","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DOCKER_BUILD_CACHE_PATH","EnvType":"string","EnvValue":"/var/lib/docker","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_BUILD_CONTEXT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_WORKFLOW_EXECUTION_STAGE","EnvType":"bool","EnvValue":"true","EnvDescription":"if enabled then we will display build stages separately for CI/Job/Pre-Post CD","Example":"true","Deprecated":"false"},{"Env":"EXTERNAL_BLOB_STORAGE_CM_NAME","EnvType":"string","EnvValue":"blob-storage-cm","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_BLOB_STORAGE_SECRET_NAME","EnvType":"string","EnvValue":"blob-storage-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CD_NODE_LABEL_SELECTOR","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CD_NODE_TAINTS_KEY","EnvType":"string","EnvValue":"dedicated","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CD_NODE_TAINTS_VALUE","EnvType":"string","EnvValue":"ci","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CI_API_SECRET","EnvType":"string","EnvValue":"devtroncd-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CI_PAYLOAD","EnvType":"string","EnvValue":"{\"ciProjectDetails\":[{\"gitRepository\":\"https://github.com/vikram1601/getting-started-nodejs.git\",\"checkoutPath\":\"./abc\",\"commitHash\":\"239077135f8cdeeccb7857e2851348f558cb53d3\",\"commitTime\":\"2022-10-30T20:00:00\",\"branch\":\"master\",\"message\":\"Update README.md\",\"author\":\"User Name \"}],\"dockerImage\":\"445808685819.dkr.ecr.us-east-2.amazonaws.com/orch:23907713-2\"}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CI_WEB_HOOK_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IGNORE_CM_CS_IN_CI_JOB","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_RETRY_COUNT","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_RETRY_INTERVAL","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCANNER_ENDPOINT","EnvType":"string","EnvValue":"http://image-scanner-new-demo-devtroncd-service.devtroncd:80","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCAN_MAX_RETRIES","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCAN_RETRY_DELAY","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IN_APP_LOGGING_ENABLED","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MAX_CD_WORKFLOW_RUNNER_RETRIES","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MAX_CI_WORKFLOW_RETRIES","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MODE","EnvType":"string","EnvValue":"DEV","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_SERVER_HOST","EnvType":"string","EnvValue":"localhost:4222","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ORCH_HOST","EnvType":"string","EnvValue":"http://devtroncd-orchestrator-service-prod.devtroncd/webhook/msg/nats","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ORCH_TOKEN","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PRE_CI_CACHE_PATH","EnvType":"string","EnvValue":"/devtroncd-cache","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SHOW_DOCKER_BUILD_ARGS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SKIP_CI_JOB_BUILD_CACHE_PUSH_PULL","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SKIP_CREATING_ECR_REPO","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINATION_GRACE_PERIOD_SECS","EnvType":"int","EnvValue":"180","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_ARTIFACT_LISTING_QUERY_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_BLOB_STORAGE_CONFIG_IN_CD_WORKFLOW","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_BLOB_STORAGE_CONFIG_IN_CI_WORKFLOW","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_BUILDX","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_DOCKER_API_TO_GET_DIGEST","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_EXTERNAL_NODE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_IMAGE_TAG_FROM_GIT_PROVIDER_FOR_TAG_BASED_BUILD","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WF_CONTROLLER_INSTANCE_ID","EnvType":"string","EnvValue":"devtron-runner","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WORKFLOW_CACHE_CONFIG","EnvType":"string","EnvValue":"{}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WORKFLOW_SERVICE_ACCOUNT","EnvType":"string","EnvValue":"ci-runner","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"DEVTRON","Fields":[{"Env":"-","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ADDITIONAL_NODE_GROUP_LABELS","EnvType":"","EnvValue":"","EnvDescription":"Add comma separated list of additional node group labels to default labels","Example":"karpenter.sh/nodepool,cloud.google.com/gke-nodepool","Deprecated":"false"},{"Env":"APP_SYNC_IMAGE","EnvType":"string","EnvValue":"quay.io/devtron/chart-sync:1227622d-132-3775","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"APP_SYNC_JOB_RESOURCES_OBJ","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"APP_SYNC_SERVICE_ACCOUNT","EnvType":"string","EnvValue":"chart-sync","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"APP_SYNC_SHUTDOWN_WAIT_DURATION","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_AUTO_SYNC_ENABLED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_GIT_COMMIT_RETRY_COUNT_ON_CONFLICT","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_GIT_COMMIT_RETRY_DELAY_ON_CONFLICT","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_REPO_REGISTER_RETRY_COUNT","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_REPO_REGISTER_RETRY_DELAY","EnvType":"int","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ASYNC_BUILDX_CACHE_EXPORT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BATCH_SIZE","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_ENABLED","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_CACHE_MODE_MIN","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_HOST","EnvType":"string","EnvValue":"localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_PORT","EnvType":"string","EnvValue":"8000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CExpirationTime","EnvType":"int","EnvValue":"600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_TRIGGER_CRON_TIME","EnvType":"int","EnvValue":"2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_WORKFLOW_STATUS_UPDATE_CRON","EnvType":"string","EnvValue":"*/5 * * * *","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CLI_CMD_TIMEOUT_GLOBAL_SECONDS","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CLUSTER_STATUS_CRON_TIME","EnvType":"int","EnvValue":"15","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CONSUMER_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_LOG_TIME_LIMIT","EnvType":"int64","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_TIMEOUT","EnvType":"float64","EnvValue":"3600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_BOM_URL","EnvType":"string","EnvValue":"https://raw.githubusercontent.com/devtron-labs/devtron/%s/charts/devtron/devtron-bom.yaml","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_DEFAULT_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_DEX_SECRET_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_RELEASE_CHART_NAME","EnvType":"string","EnvValue":"devtron-operator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_RELEASE_NAME","EnvType":"string","EnvValue":"devtron","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_RELEASE_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_REPO_NAME","EnvType":"string","EnvValue":"devtron","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_REPO_URL","EnvType":"string","EnvValue":"https://helm.devtron.ai","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_INSTALLATION_TYPE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_MODULES_IDENTIFIER_IN_HELM_VALUES","EnvType":"string","EnvValue":"installer.modules","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_SECRET_NAME","EnvType":"string","EnvValue":"devtron-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_VERSION_IDENTIFIER_IN_HELM_VALUES","EnvType":"string","EnvValue":"installer.release","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_CID","EnvType":"string","EnvValue":"example-app","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_CLIENT_ID","EnvType":"string","EnvValue":"argo-cd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_CSTOREKEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_JWTKEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_RURL","EnvType":"string","EnvValue":"http://127.0.0.1:8080/callback","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_SECRET","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ECR_REPO_NAME_PREFIX","EnvType":"string","EnvValue":"test/","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_ASYNC_ARGO_CD_INSTALL_DEVTRON_CHART","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_ASYNC_INSTALL_DEVTRON_CHART","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EPHEMERAL_SERVER_VERSION_REGEX","EnvType":"string","EnvValue":"v[1-9]\\.\\b(2[3-9]\\|[3-9][0-9])\\b.*","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EVENT_URL","EnvType":"string","EnvValue":"http://localhost:3000/notify","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXECUTE_WIRE_NIL_CHECKER","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXPOSE_CI_METRICS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FEATURE_RESTART_WORKLOAD_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FEATURE_RESTART_WORKLOAD_WORKER_POOL_SIZE","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FORCE_SECURITY_SCANNING","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GITOPS_REPO_PREFIX","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GO_RUNTIME_ENV","EnvType":"string","EnvValue":"production","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_HOST","EnvType":"string","EnvValue":"localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_ORG_ID","EnvType":"int","EnvValue":"2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_PASSWORD","EnvType":"string","EnvValue":"prom-operator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_PORT","EnvType":"string","EnvValue":"8090","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_USERNAME","EnvType":"string","EnvValue":"admin","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"HIDE_IMAGE_TAGGING_HARD_DELETE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IGNORE_AUTOCOMPLETE_AUTH_CHECK","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_OBJECT_GROUP_NAME","EnvType":"string","EnvValue":"installer.devtron.ai","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_OBJECT_RESOURCE","EnvType":"string","EnvValue":"installers","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_OBJECT_VERSION","EnvType":"string","EnvValue":"v1alpha1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"JwtExpirationTime","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_CLIENT_MAX_IDLE_CONNS_PER_HOST","EnvType":"int","EnvValue":"25","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TCP_IDLE_CONN_TIMEOUT","EnvType":"int","EnvValue":"300","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TCP_KEEPALIVE","EnvType":"int","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TCP_TIMEOUT","EnvType":"int","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TLS_HANDSHAKE_TIMEOUT","EnvType":"int","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"KUBELINK_GRPC_MAX_RECEIVE_MSG_SIZE","EnvType":"int","EnvValue":"20","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"KUBELINK_GRPC_MAX_SEND_MSG_SIZE","EnvType":"int","EnvValue":"4","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LENS_TIMEOUT","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LENS_URL","EnvType":"string","EnvValue":"http://lens-milandevtron-service:80","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LIMIT_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LIMIT_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LOGGER_DEV_MODE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LOG_LEVEL","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MAX_SESSION_PER_USER","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MODULE_METADATA_API_URL","EnvType":"string","EnvValue":"https://api.devtron.ai/module?name=%s","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MODULE_STATUS_HANDLING_CRON_DURATION_MIN","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_ACK_WAIT_IN_SECS","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_BUFFER_SIZE","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_MAX_AGE","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_PROCESSING_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_REPLICAS","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NOTIFICATION_MEDIUM","EnvType":"NotificationMedium","EnvValue":"rest","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"OTEL_COLLECTOR_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PARALLELISM_LIMIT_FOR_TAG_PROCESSING","EnvType":"int","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_EXPORT_PROM_METRICS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_FAILURE_QUERIES","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_QUERY","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_SLOW_QUERY","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_QUERY_DUR_THRESHOLD","EnvType":"int64","EnvValue":"5000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PLUGIN_NAME","EnvType":"string","EnvValue":"Pull images from container repository","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PROPAGATE_EXTRA_LABELS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PROXY_SERVICE_CONFIG","EnvType":"string","EnvValue":"{}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REQ_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REQ_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RESTRICT_TERMINAL_ACCESS_FOR_NON_SUPER_USER","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RUNTIME_CONFIG_LOCAL_DEV","EnvType":"LocalDevMode","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_ENABLED","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_FORMAT","EnvType":"string","EnvValue":"@{{%s}}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_HANDLE_PRIMITIVES","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_NAME_REGEX","EnvType":"string","EnvValue":"^[a-zA-Z][a-zA-Z0-9_-]{0,62}[a-zA-Z0-9]$","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SOCKET_DISCONNECT_DELAY_SECONDS","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SOCKET_HEARTBEAT_SECONDS","EnvType":"int","EnvValue":"25","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"STREAM_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SYSTEM_VAR_PREFIX","EnvType":"string","EnvValue":"DEVTRON_","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINAL_POD_DEFAULT_NAMESPACE","EnvType":"string","EnvValue":"default","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINAL_POD_INACTIVE_DURATION_IN_MINS","EnvType":"int","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINAL_POD_STATUS_SYNC_In_SECS","EnvType":"int","EnvValue":"600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_APP","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_ADDR","EnvType":"string","EnvValue":"127.0.0.1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_DATABASE","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_LOG_QUERY","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_PASSWORD","EnvType":"string","EnvValue":"postgrespw","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_PORT","EnvType":"string","EnvValue":"55000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_USER","EnvType":"string","EnvValue":"postgres","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TIMEOUT_FOR_FAILED_CI_BUILD","EnvType":"string","EnvValue":"15","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TIMEOUT_IN_SECONDS","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USER_SESSION_DURATION_SECONDS","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_ARTIFACT_LISTING_API_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_CUSTOM_HTTP_TRANSPORT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_GIT_CLI","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_RBAC_CREATION_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"VARIABLE_CACHE_ENABLED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"VARIABLE_EXPRESSION_REGEX","EnvType":"string","EnvValue":"@{{([^}]+)}}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WEBHOOK_TOKEN","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"GITOPS","Fields":[{"Env":"ACD_CM","EnvType":"string","EnvValue":"argocd-cm","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ACD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ACD_PASSWORD","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ACD_USERNAME","EnvType":"string","EnvValue":"admin","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GITOPS_SECRET_NAME","EnvType":"string","EnvValue":"devtron-gitops-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RESOURCE_LIST_FOR_REPLICAS","EnvType":"string","EnvValue":"Deployment,Rollout,StatefulSet,ReplicaSet","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RESOURCE_LIST_FOR_REPLICAS_BATCH_SIZE","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"INFRA_SETUP","Fields":[{"Env":"DASHBOARD_HOST","EnvType":"string","EnvValue":"localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DASHBOARD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DASHBOARD_PORT","EnvType":"string","EnvValue":"3000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_HOST","EnvType":"string","EnvValue":"http://localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_PORT","EnvType":"string","EnvValue":"5556","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GIT_SENSOR_PROTOCOL","EnvType":"string","EnvValue":"REST","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GIT_SENSOR_TIMEOUT","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GIT_SENSOR_URL","EnvType":"string","EnvValue":"127.0.0.1:7070","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"HELM_CLIENT_URL","EnvType":"string","EnvValue":"127.0.0.1:50051","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"POSTGRES","Fields":[{"Env":"APP","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"Application name","Example":"","Deprecated":"false"},{"Env":"CASBIN_DATABASE","EnvType":"string","EnvValue":"casbin","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_ADDR","EnvType":"string","EnvValue":"127.0.0.1","EnvDescription":"address of postgres service","Example":"postgresql-postgresql.devtroncd","Deprecated":"false"},{"Env":"PG_DATABASE","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"postgres database to be made connection with","Example":"orchestrator, casbin, git_sensor, lens","Deprecated":"false"},{"Env":"PG_PASSWORD","EnvType":"string","EnvValue":"{password}","EnvDescription":"password for postgres, associated with PG_USER","Example":"confidential ;)","Deprecated":"false"},{"Env":"PG_PORT","EnvType":"string","EnvValue":"5432","EnvDescription":"port of postgresql service","Example":"5432","Deprecated":"false"},{"Env":"PG_READ_TIMEOUT","EnvType":"int64","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_USER","EnvType":"string","EnvValue":"postgres","EnvDescription":"user for postgres","Example":"postgres","Deprecated":"false"},{"Env":"PG_WRITE_TIMEOUT","EnvType":"int64","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"RBAC","Fields":[{"Env":"ENFORCER_CACHE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENFORCER_CACHE_EXPIRATION_IN_SEC","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENFORCER_MAX_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_CASBIN_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"}]}]
\ No newline at end of file
+[{"Category":"CD","Fields":[{"Env":"ARGO_APP_MANUAL_SYNC_TIME","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_HELM_PIPELINE_STATUS_CRON_TIME","EnvType":"string","EnvValue":"*/2 * * * *","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_PIPELINE_STATUS_CRON_TIME","EnvType":"string","EnvValue":"*/2 * * * *","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_PIPELINE_STATUS_TIMEOUT_DURATION","EnvType":"string","EnvValue":"20","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEPLOY_STATUS_CRON_GET_PIPELINE_DEPLOYED_WITHIN_HOURS","EnvType":"int","EnvValue":"12","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_CHART_ARGO_CD_INSTALL_REQUEST_TIMEOUT","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_CHART_INSTALL_REQUEST_TIMEOUT","EnvType":"int","EnvValue":"6","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXPOSE_CD_METRICS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FEATURE_MIGRATE_ARGOCD_APPLICATION_ENABLE","EnvType":"bool","EnvValue":"false","EnvDescription":"enable migration of external argocd application to devtron pipeline","Example":"","Deprecated":"false"},{"Env":"HELM_PIPELINE_STATUS_CHECK_ELIGIBLE_TIME","EnvType":"string","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IS_INTERNAL_USE","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MIGRATE_DEPLOYMENT_CONFIG_DATA","EnvType":"bool","EnvValue":"false","EnvDescription":"migrate deployment config data from charts table to deployment_config table","Example":"","Deprecated":"false"},{"Env":"PIPELINE_DEGRADED_TIME","EnvType":"string","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_DEVTRON_APP","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_EXTERNAL_HELM_APP","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_HELM_APP","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REVISION_HISTORY_LIMIT_LINKED_HELM_APP","EnvType":"int","EnvValue":"15","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RUN_HELM_INSTALL_IN_ASYNC_MODE_HELM_APPS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SHOULD_CHECK_NAMESPACE_ON_CLONE","EnvType":"bool","EnvValue":"false","EnvDescription":"should we check if namespace exists or not while cloning app","Example":"","Deprecated":"false"},{"Env":"USE_DEPLOYMENT_CONFIG_DATA","EnvType":"bool","EnvValue":"false","EnvDescription":"use deployment config data from deployment_config table","Example":"","Deprecated":"true"}]},{"Category":"CI_RUNNER","Fields":[{"Env":"AZURE_ACCOUNT_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_ACCOUNT_NAME","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_CACHE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_BLOB_CONTAINER_CI_LOG","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_CONNECTION_INSECURE","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"AZURE_GATEWAY_URL","EnvType":"string","EnvValue":"http://devtron-minio.devtroncd:9000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BASE_LOG_LOCATION_PATH","EnvType":"string","EnvValue":"/home/devtron/","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_GCP_CREDENTIALS_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_PROVIDER","EnvType":"","EnvValue":"S3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ACCESS_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_BUCKET_VERSIONED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_ENDPOINT_INSECURE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_S3_SECRET_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_CACHE_PATH","EnvType":"string","EnvValue":"/var/lib/devtron/buildx","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_K8S_DRIVER_OPTIONS","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_PROVENANCE_MODE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILD_LOG_TTL_VALUE_IN_SECS","EnvType":"int","EnvValue":"3600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CACHE_LIMIT","EnvType":"int64","EnvValue":"5000000000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_DEFAULT_ADDRESS_POOL_BASE_CIDR","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_DEFAULT_ADDRESS_POOL_SIZE","EnvType":"int","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_LIMIT_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_LIMIT_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NODE_LABEL_SELECTOR","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NODE_TAINTS_KEY","EnvType":"string","EnvValue":"dedicated","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NODE_TAINTS_VALUE","EnvType":"string","EnvValue":"ci","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_REQ_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_REQ_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_WORKFLOW_EXECUTOR_TYPE","EnvType":"","EnvValue":"AWF","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_WORKFLOW_SERVICE_ACCOUNT","EnvType":"string","EnvValue":"cd-runner","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_DEFAULT_ADDRESS_POOL_BASE_CIDR","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_DEFAULT_ADDRESS_POOL_SIZE","EnvType":"int","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_IGNORE_DOCKER_CACHE","EnvType":"bool","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_LOGS_KEY_PREFIX","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_NODE_LABEL_SELECTOR","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_NODE_TAINTS_KEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_NODE_TAINTS_VALUE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_RUNNER_DOCKER_MTU_VALUE","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_SUCCESS_AUTO_TRIGGER_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_VOLUME_MOUNTS_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_WORKFLOW_EXECUTOR_TYPE","EnvType":"","EnvValue":"AWF","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_ARTIFACT_KEY_LOCATION","EnvType":"string","EnvValue":"arsenal-v1/ci-artifacts","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_BUILD_LOGS_BUCKET","EnvType":"string","EnvValue":"devtron-pro-ci-logs","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_BUILD_LOGS_KEY_PREFIX","EnvType":"string","EnvValue":"arsenal-v1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET","EnvType":"string","EnvValue":"ci-caching","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CACHE_BUCKET_REGION","EnvType":"string","EnvValue":"us-east-2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_ARTIFACT_KEY_LOCATION","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_LOGS_BUCKET_REGION","EnvType":"string","EnvValue":"us-east-2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_NAMESPACE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CD_TIMEOUT","EnvType":"int64","EnvValue":"3600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_CI_IMAGE","EnvType":"string","EnvValue":"686244538589.dkr.ecr.us-east-2.amazonaws.com/cirunner:47","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_NAMESPACE","EnvType":"string","EnvValue":"devtron-ci","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_TARGET_PLATFORM","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DOCKER_BUILD_CACHE_PATH","EnvType":"string","EnvValue":"/var/lib/docker","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_BUILD_CONTEXT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_WORKFLOW_EXECUTION_STAGE","EnvType":"bool","EnvValue":"true","EnvDescription":"if enabled then we will display build stages separately for CI/Job/Pre-Post CD","Example":"true","Deprecated":"false"},{"Env":"EXTERNAL_BLOB_STORAGE_CM_NAME","EnvType":"string","EnvValue":"blob-storage-cm","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_BLOB_STORAGE_SECRET_NAME","EnvType":"string","EnvValue":"blob-storage-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CD_NODE_LABEL_SELECTOR","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CD_NODE_TAINTS_KEY","EnvType":"string","EnvValue":"dedicated","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CD_NODE_TAINTS_VALUE","EnvType":"string","EnvValue":"ci","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CI_API_SECRET","EnvType":"string","EnvValue":"devtroncd-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CI_PAYLOAD","EnvType":"string","EnvValue":"{\"ciProjectDetails\":[{\"gitRepository\":\"https://github.com/vikram1601/getting-started-nodejs.git\",\"checkoutPath\":\"./abc\",\"commitHash\":\"239077135f8cdeeccb7857e2851348f558cb53d3\",\"commitTime\":\"2022-10-30T20:00:00\",\"branch\":\"master\",\"message\":\"Update README.md\",\"author\":\"User Name \"}],\"dockerImage\":\"445808685819.dkr.ecr.us-east-2.amazonaws.com/orch:23907713-2\"}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXTERNAL_CI_WEB_HOOK_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IGNORE_CM_CS_IN_CI_JOB","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_RETRY_COUNT","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_RETRY_INTERVAL","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCANNER_ENDPOINT","EnvType":"string","EnvValue":"http://image-scanner-new-demo-devtroncd-service.devtroncd:80","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCAN_MAX_RETRIES","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IMAGE_SCAN_RETRY_DELAY","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IN_APP_LOGGING_ENABLED","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MAX_CD_WORKFLOW_RUNNER_RETRIES","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MAX_CI_WORKFLOW_RETRIES","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MODE","EnvType":"string","EnvValue":"DEV","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_SERVER_HOST","EnvType":"string","EnvValue":"localhost:4222","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ORCH_HOST","EnvType":"string","EnvValue":"http://devtroncd-orchestrator-service-prod.devtroncd/webhook/msg/nats","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ORCH_TOKEN","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PRE_CI_CACHE_PATH","EnvType":"string","EnvValue":"/devtroncd-cache","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SHOW_DOCKER_BUILD_ARGS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SKIP_CI_JOB_BUILD_CACHE_PUSH_PULL","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SKIP_CREATING_ECR_REPO","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINATION_GRACE_PERIOD_SECS","EnvType":"int","EnvValue":"180","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_ARTIFACT_LISTING_QUERY_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_BLOB_STORAGE_CONFIG_IN_CD_WORKFLOW","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_BLOB_STORAGE_CONFIG_IN_CI_WORKFLOW","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_BUILDX","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_DOCKER_API_TO_GET_DIGEST","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_EXTERNAL_NODE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_IMAGE_TAG_FROM_GIT_PROVIDER_FOR_TAG_BASED_BUILD","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WF_CONTROLLER_INSTANCE_ID","EnvType":"string","EnvValue":"devtron-runner","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WORKFLOW_CACHE_CONFIG","EnvType":"string","EnvValue":"{}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WORKFLOW_SERVICE_ACCOUNT","EnvType":"string","EnvValue":"ci-runner","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"DEVTRON","Fields":[{"Env":"-","EnvType":"","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ADDITIONAL_NODE_GROUP_LABELS","EnvType":"","EnvValue":"","EnvDescription":"Add comma separated list of additional node group labels to default labels","Example":"karpenter.sh/nodepool,cloud.google.com/gke-nodepool","Deprecated":"false"},{"Env":"APP_SYNC_IMAGE","EnvType":"string","EnvValue":"quay.io/devtron/chart-sync:1227622d-132-3775","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"APP_SYNC_JOB_RESOURCES_OBJ","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"APP_SYNC_SERVICE_ACCOUNT","EnvType":"string","EnvValue":"chart-sync","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"APP_SYNC_SHUTDOWN_WAIT_DURATION","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_AUTO_SYNC_ENABLED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_GIT_COMMIT_RETRY_COUNT_ON_CONFLICT","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_GIT_COMMIT_RETRY_DELAY_ON_CONFLICT","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_REPO_REGISTER_RETRY_COUNT","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ARGO_REPO_REGISTER_RETRY_DELAY","EnvType":"int","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ASYNC_BUILDX_CACHE_EXPORT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BATCH_SIZE","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BLOB_STORAGE_ENABLED","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"BUILDX_CACHE_MODE_MIN","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_HOST","EnvType":"string","EnvValue":"localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CD_PORT","EnvType":"string","EnvValue":"8000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CExpirationTime","EnvType":"int","EnvValue":"600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_TRIGGER_CRON_TIME","EnvType":"int","EnvValue":"2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CI_WORKFLOW_STATUS_UPDATE_CRON","EnvType":"string","EnvValue":"*/5 * * * *","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CLI_CMD_TIMEOUT_GLOBAL_SECONDS","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CLUSTER_STATUS_CRON_TIME","EnvType":"int","EnvValue":"15","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"CONSUMER_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_LOG_TIME_LIMIT","EnvType":"int64","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEFAULT_TIMEOUT","EnvType":"float64","EnvValue":"3600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_BOM_URL","EnvType":"string","EnvValue":"https://raw.githubusercontent.com/devtron-labs/devtron/%s/charts/devtron/devtron-bom.yaml","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_DEFAULT_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_DEX_SECRET_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_RELEASE_CHART_NAME","EnvType":"string","EnvValue":"devtron-operator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_RELEASE_NAME","EnvType":"string","EnvValue":"devtron","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_RELEASE_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_REPO_NAME","EnvType":"string","EnvValue":"devtron","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_HELM_REPO_URL","EnvType":"string","EnvValue":"https://helm.devtron.ai","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_INSTALLATION_TYPE","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_MODULES_IDENTIFIER_IN_HELM_VALUES","EnvType":"string","EnvValue":"installer.modules","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_SECRET_NAME","EnvType":"string","EnvValue":"devtron-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEVTRON_VERSION_IDENTIFIER_IN_HELM_VALUES","EnvType":"string","EnvValue":"installer.release","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_CID","EnvType":"string","EnvValue":"example-app","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_CLIENT_ID","EnvType":"string","EnvValue":"argo-cd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_CSTOREKEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_JWTKEY","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_RURL","EnvType":"string","EnvValue":"http://127.0.0.1:8080/callback","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_SECRET","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ECR_REPO_NAME_PREFIX","EnvType":"string","EnvValue":"test/","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_ASYNC_ARGO_CD_INSTALL_DEVTRON_CHART","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENABLE_ASYNC_INSTALL_DEVTRON_CHART","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EPHEMERAL_SERVER_VERSION_REGEX","EnvType":"string","EnvValue":"v[1-9]\\.\\b(2[3-9]\\|[3-9][0-9])\\b.*","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EVENT_URL","EnvType":"string","EnvValue":"http://localhost:3000/notify","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXECUTE_WIRE_NIL_CHECKER","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"EXPOSE_CI_METRICS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FEATURE_RESTART_WORKLOAD_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FEATURE_RESTART_WORKLOAD_WORKER_POOL_SIZE","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"FORCE_SECURITY_SCANNING","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GITOPS_REPO_PREFIX","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GO_RUNTIME_ENV","EnvType":"string","EnvValue":"production","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_HOST","EnvType":"string","EnvValue":"localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_ORG_ID","EnvType":"int","EnvValue":"2","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_PASSWORD","EnvType":"string","EnvValue":"prom-operator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_PORT","EnvType":"string","EnvValue":"8090","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GRAFANA_USERNAME","EnvType":"string","EnvValue":"admin","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"HIDE_IMAGE_TAGGING_HARD_DELETE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IGNORE_AUTOCOMPLETE_AUTH_CHECK","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLED_MODULES","EnvType":"","EnvValue":"","EnvDescription":"List of installed modules given in helm values/yaml are written in cm and used by devtron to know which modules are given","Example":"security.trivy,security.clair","Deprecated":"false"},{"Env":"INSTALLER_CRD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_OBJECT_GROUP_NAME","EnvType":"string","EnvValue":"installer.devtron.ai","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_OBJECT_RESOURCE","EnvType":"string","EnvValue":"installers","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"INSTALLER_CRD_OBJECT_VERSION","EnvType":"string","EnvValue":"v1alpha1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"IS_AIR_GAP_ENVIRONMENT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"JwtExpirationTime","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_CLIENT_MAX_IDLE_CONNS_PER_HOST","EnvType":"int","EnvValue":"25","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TCP_IDLE_CONN_TIMEOUT","EnvType":"int","EnvValue":"300","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TCP_KEEPALIVE","EnvType":"int","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TCP_TIMEOUT","EnvType":"int","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"K8s_TLS_HANDSHAKE_TIMEOUT","EnvType":"int","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"KUBELINK_GRPC_MAX_RECEIVE_MSG_SIZE","EnvType":"int","EnvValue":"20","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"KUBELINK_GRPC_MAX_SEND_MSG_SIZE","EnvType":"int","EnvValue":"4","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LENS_TIMEOUT","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LENS_URL","EnvType":"string","EnvValue":"http://lens-milandevtron-service:80","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LIMIT_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LIMIT_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LOGGER_DEV_MODE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"LOG_LEVEL","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MAX_SESSION_PER_USER","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MODULE_METADATA_API_URL","EnvType":"string","EnvValue":"https://api.devtron.ai/module?name=%s","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"MODULE_STATUS_HANDLING_CRON_DURATION_MIN","EnvType":"int","EnvValue":"3","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_ACK_WAIT_IN_SECS","EnvType":"int","EnvValue":"120","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_BUFFER_SIZE","EnvType":"int","EnvValue":"-1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_MAX_AGE","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_PROCESSING_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NATS_MSG_REPLICAS","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"NOTIFICATION_MEDIUM","EnvType":"NotificationMedium","EnvValue":"rest","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"OTEL_COLLECTOR_URL","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PARALLELISM_LIMIT_FOR_TAG_PROCESSING","EnvType":"int","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_EXPORT_PROM_METRICS","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_FAILURE_QUERIES","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_ALL_QUERY","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_LOG_SLOW_QUERY","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_QUERY_DUR_THRESHOLD","EnvType":"int64","EnvValue":"5000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PLUGIN_NAME","EnvType":"string","EnvValue":"Pull images from container repository","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PROPAGATE_EXTRA_LABELS","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PROXY_SERVICE_CONFIG","EnvType":"string","EnvValue":"{}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REQ_CI_CPU","EnvType":"string","EnvValue":"0.5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"REQ_CI_MEM","EnvType":"string","EnvValue":"3G","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RESTRICT_TERMINAL_ACCESS_FOR_NON_SUPER_USER","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RUNTIME_CONFIG_LOCAL_DEV","EnvType":"LocalDevMode","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_ENABLED","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_FORMAT","EnvType":"string","EnvValue":"@{{%s}}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_HANDLE_PRIMITIVES","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SCOPED_VARIABLE_NAME_REGEX","EnvType":"string","EnvValue":"^[a-zA-Z][a-zA-Z0-9_-]{0,62}[a-zA-Z0-9]$","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SOCKET_DISCONNECT_DELAY_SECONDS","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SOCKET_HEARTBEAT_SECONDS","EnvType":"int","EnvValue":"25","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"STREAM_CONFIG_JSON","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"SYSTEM_VAR_PREFIX","EnvType":"string","EnvValue":"DEVTRON_","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINAL_POD_DEFAULT_NAMESPACE","EnvType":"string","EnvValue":"default","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINAL_POD_INACTIVE_DURATION_IN_MINS","EnvType":"int","EnvValue":"10","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TERMINAL_POD_STATUS_SYNC_In_SECS","EnvType":"int","EnvValue":"600","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_APP","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_ADDR","EnvType":"string","EnvValue":"127.0.0.1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_DATABASE","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_LOG_QUERY","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_PASSWORD","EnvType":"string","EnvValue":"postgrespw","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_PORT","EnvType":"string","EnvValue":"55000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TEST_PG_USER","EnvType":"string","EnvValue":"postgres","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TIMEOUT_FOR_FAILED_CI_BUILD","EnvType":"string","EnvValue":"15","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"TIMEOUT_IN_SECONDS","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USER_SESSION_DURATION_SECONDS","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_ARTIFACT_LISTING_API_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_CUSTOM_HTTP_TRANSPORT","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_GIT_CLI","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_RBAC_CREATION_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"VARIABLE_CACHE_ENABLED","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"VARIABLE_EXPRESSION_REGEX","EnvType":"string","EnvValue":"@{{([^}]+)}}","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"WEBHOOK_TOKEN","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"GITOPS","Fields":[{"Env":"ACD_CM","EnvType":"string","EnvValue":"argocd-cm","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ACD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ACD_PASSWORD","EnvType":"string","EnvValue":"","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ACD_USERNAME","EnvType":"string","EnvValue":"admin","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GITOPS_SECRET_NAME","EnvType":"string","EnvValue":"devtron-gitops-secret","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RESOURCE_LIST_FOR_REPLICAS","EnvType":"string","EnvValue":"Deployment,Rollout,StatefulSet,ReplicaSet","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"RESOURCE_LIST_FOR_REPLICAS_BATCH_SIZE","EnvType":"int","EnvValue":"5","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"INFRA_SETUP","Fields":[{"Env":"DASHBOARD_HOST","EnvType":"string","EnvValue":"localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DASHBOARD_NAMESPACE","EnvType":"string","EnvValue":"devtroncd","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DASHBOARD_PORT","EnvType":"string","EnvValue":"3000","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_HOST","EnvType":"string","EnvValue":"http://localhost","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"DEX_PORT","EnvType":"string","EnvValue":"5556","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GIT_SENSOR_PROTOCOL","EnvType":"string","EnvValue":"REST","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GIT_SENSOR_TIMEOUT","EnvType":"int","EnvValue":"0","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"GIT_SENSOR_URL","EnvType":"string","EnvValue":"127.0.0.1:7070","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"HELM_CLIENT_URL","EnvType":"string","EnvValue":"127.0.0.1:50051","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"POSTGRES","Fields":[{"Env":"APP","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"Application name","Example":"","Deprecated":"false"},{"Env":"CASBIN_DATABASE","EnvType":"string","EnvValue":"casbin","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_ADDR","EnvType":"string","EnvValue":"127.0.0.1","EnvDescription":"address of postgres service","Example":"postgresql-postgresql.devtroncd","Deprecated":"false"},{"Env":"PG_DATABASE","EnvType":"string","EnvValue":"orchestrator","EnvDescription":"postgres database to be made connection with","Example":"orchestrator, casbin, git_sensor, lens","Deprecated":"false"},{"Env":"PG_PASSWORD","EnvType":"string","EnvValue":"{password}","EnvDescription":"password for postgres, associated with PG_USER","Example":"confidential ;)","Deprecated":"false"},{"Env":"PG_PORT","EnvType":"string","EnvValue":"5432","EnvDescription":"port of postgresql service","Example":"5432","Deprecated":"false"},{"Env":"PG_READ_TIMEOUT","EnvType":"int64","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"PG_USER","EnvType":"string","EnvValue":"postgres","EnvDescription":"user for postgres","Example":"postgres","Deprecated":"false"},{"Env":"PG_WRITE_TIMEOUT","EnvType":"int64","EnvValue":"30","EnvDescription":"","Example":"","Deprecated":"false"}]},{"Category":"RBAC","Fields":[{"Env":"ENFORCER_CACHE","EnvType":"bool","EnvValue":"false","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENFORCER_CACHE_EXPIRATION_IN_SEC","EnvType":"int","EnvValue":"86400","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"ENFORCER_MAX_BATCH_SIZE","EnvType":"int","EnvValue":"1","EnvDescription":"","Example":"","Deprecated":"false"},{"Env":"USE_CASBIN_V2","EnvType":"bool","EnvValue":"true","EnvDescription":"","Example":"","Deprecated":"false"}]}]
\ No newline at end of file
diff --git a/env_gen.md b/env_gen.md
index dc55f006de..f247bf8a1f 100644
--- a/env_gen.md
+++ b/env_gen.md
@@ -191,10 +191,12 @@
| GRAFANA_USERNAME | string |admin | | | false |
| HIDE_IMAGE_TAGGING_HARD_DELETE | bool |false | | | false |
| IGNORE_AUTOCOMPLETE_AUTH_CHECK | bool |false | | | false |
+ | INSTALLED_MODULES | | | List of installed modules given in helm values/yaml are written in cm and used by devtron to know which modules are given | security.trivy,security.clair | false |
| INSTALLER_CRD_NAMESPACE | string |devtroncd | | | false |
| INSTALLER_CRD_OBJECT_GROUP_NAME | string |installer.devtron.ai | | | false |
| INSTALLER_CRD_OBJECT_RESOURCE | string |installers | | | false |
| INSTALLER_CRD_OBJECT_VERSION | string |v1alpha1 | | | false |
+ | IS_AIR_GAP_ENVIRONMENT | bool |false | | | false |
| JwtExpirationTime | int |120 | | | false |
| K8s_CLIENT_MAX_IDLE_CONNS_PER_HOST | int |25 | | | false |
| K8s_TCP_IDLE_CONN_TIMEOUT | int |300 | | | false |
diff --git a/go.mod b/go.mod
index bd0f0ed4f1..562a4d800a 100644
--- a/go.mod
+++ b/go.mod
@@ -49,13 +49,13 @@ require (
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80
github.com/invopop/jsonschema v0.7.0
- github.com/juju/errors v0.0.0-20200330140219-3fe23663418f
+ github.com/juju/errors v1.0.0
github.com/lib/pq v1.10.9
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
github.com/otiai10/copy v1.0.2
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
- github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a
+ github.com/posthog/posthog-go v1.4.1
github.com/prometheus/client_golang v1.18.0
github.com/robfig/cron/v3 v3.0.1
github.com/satori/go.uuid v1.2.0
@@ -81,7 +81,7 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.33.0
- gopkg.in/go-playground/validator.v9 v9.30.0
+ gopkg.in/go-playground/validator.v9 v9.31.0
gopkg.in/igm/sockjs-go.v3 v3.0.0
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.14.3
@@ -151,8 +151,8 @@ require (
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.6 // indirect
- github.com/go-playground/locales v0.14.0 // indirect
- github.com/go-playground/universal-translator v0.18.0 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-redis/cache/v9 v9.0.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/go-xorm/xorm v0.7.9 // indirect
@@ -187,11 +187,10 @@ require (
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
- github.com/leodido/go-urn v1.2.0 // indirect
+ github.com/leodido/go-urn v1.4.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
@@ -238,7 +237,6 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
- github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
@@ -258,7 +256,6 @@ require (
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
- gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
@@ -291,8 +288,8 @@ require (
replace (
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
- github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250327100051-86261f25ea82
- github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250327100051-86261f25ea82
+ github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250401095543-affde454fe43
+ github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250401095543-affde454fe43
github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
k8s.io/api => k8s.io/api v0.29.7
diff --git a/go.sum b/go.sum
index 348bf692fe..fff2376d02 100644
--- a/go.sum
+++ b/go.sum
@@ -773,7 +773,6 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWH
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/coreos/go-oidc/v3 v3.11.0 h1:Ia3MxdwpSw702YW0xgfmP1GVCMA9aEFWu12XUZ3/OtI=
github.com/coreos/go-oidc/v3 v3.11.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0=
-github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
@@ -792,10 +791,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
-github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250327100051-86261f25ea82 h1:Wwt11QiLXCBlXosYGyEw9MVUfKMYzZ64+BrOV5Y1yWQ=
-github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250327100051-86261f25ea82/go.mod h1:5lv4Wfj5ERhhvDGXe2IeES6qxjvUVCcohaRwKnWBMNo=
-github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250327100051-86261f25ea82 h1:H03IwPCU3KbIWLncvAqjJlGnJZ15f/wj5G77SiNTYoM=
-github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250327100051-86261f25ea82/go.mod h1:1QJJLpgJSkb5Jm9xPeKAk+kXb0QgBOOOgJj0cgYhAVA=
+github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250401095543-affde454fe43 h1:sNxDziQuDDVTch6wPI9/d6lCkIml/2RvyLK7S//Zj9c=
+github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250401095543-affde454fe43/go.mod h1:5lv4Wfj5ERhhvDGXe2IeES6qxjvUVCcohaRwKnWBMNo=
+github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250401095543-affde454fe43 h1:yGHHNhpaGPpOlj5O+bT4hJrNxr1J3opRZCPWk84NGms=
+github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250401095543-affde454fe43/go.mod h1:eJxpq4uIG1fww604WrQAlf1Gkr66b59LHaOOod6t6FA=
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs=
@@ -925,10 +924,10 @@ github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhO
github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
github.com/go-pg/pg v6.15.1+incompatible h1:vO4P9WoCi+i4qomgcBXWlKgDk4GcHAqDAOIfkEpi7B4=
github.com/go-pg/pg v6.15.1+incompatible/go.mod h1:a2oXow+aFOrvwcKs3eIA0lNFmMilrxK2sOkB5NWe0vA=
-github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
-github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
-github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
-github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-redis/cache/v9 v9.0.0 h1:0thdtFo0xJi0/WXbRVu8B066z8OvVymXTJGaXrVWnN0=
github.com/go-redis/cache/v9 v9.0.0/go.mod h1:cMwi1N8ASBOufbIvk7cdXe2PbPjK/WMRL95FFHWsSgI=
github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY=
@@ -1188,34 +1187,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU=
-github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA=
-github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18=
-github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY=
-github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
-github.com/juju/errors v0.0.0-20200330140219-3fe23663418f h1:MCOvExGLpaSIzLYB4iQXEHP4jYVU6vmzLNQPdMVrxnM=
-github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
-github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
-github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g=
-github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
-github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e h1:FdDd7bdI6cjq5vaoYlK1mfQYfF9sF2VZw8VEZMsl5t8=
-github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
-github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A=
-github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg=
-github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY=
-github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4=
-github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4=
-github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA=
-github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA=
-github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098 h1:yrhek184cGp0IRyHg0uV1khLaorNg6GtDLkry4oNNjE=
-github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM=
-github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk=
-github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk=
-github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI=
-github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U=
-github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U=
-github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U=
-github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/juju/errors v1.0.0 h1:yiq7kjCLll1BiaRuNY53MGI0+EQ3rF6GB+wvboZDefM=
+github.com/juju/errors v1.0.0/go.mod h1:B5x9thDqx0wIMH3+aLIMP9HjItInYWObRovoCFM5Qe8=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
@@ -1254,8 +1227,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
-github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
-github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
+github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
+github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
@@ -1263,25 +1236,18 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
-github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE=
-github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc=
-github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E=
-github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY=
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
-github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
-github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
@@ -1343,7 +1309,6 @@ github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADym
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
-github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
@@ -1424,8 +1389,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a h1:wm95cDvqeISA1Vs2a56hEtERmzZ3bNrRQSuDbeZr9GU=
-github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a/go.mod h1:oa2sAs9tGai3VldabTV0eWejt/O4/OOD7azP8GaikqU=
+github.com/posthog/posthog-go v1.4.1 h1:uNGYCKJibU5epw44Rbnr680jRWeuEZ5jXqyUO27aysw=
+github.com/posthog/posthog-go v1.4.1/go.mod h1:uYC2l1Yktc8E+9FAHJ9QZG4vQf/NHJPD800Hsm7DzoM=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
@@ -1459,7 +1424,6 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
-github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
@@ -1470,7 +1434,6 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
-github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
@@ -1524,7 +1487,6 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.4 h1:cuiLzLnaMeBhRmEv00Lpk3tkYrcxpmbU81tAY4Dw0tc=
github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM=
-github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vmihailenco/go-tinylfu v0.2.2 h1:H1eiG6HM36iniK6+21n9LLpzx1G9R3DJa2UjUjbynsI=
github.com/vmihailenco/go-tinylfu v0.2.2/go.mod h1:CutYi2Q9puTxfcolkliPq4npPuofg9N9t8JVrjzwa3Q=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
@@ -1546,8 +1508,6 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
-github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g=
-github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=
github.com/yannh/kubeconform v0.5.0 h1:jWiG96hVRRj0DV1W+Et0TeXen0BuitDUfubOif1pdNw=
github.com/yannh/kubeconform v0.5.0/go.mod h1:5md2J7KvQFj+sICN5Je5ckhUcgPoPISuntVJr4Hnr08=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -1614,7 +1574,6 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8
go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
-golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -1624,7 +1583,6 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
@@ -1715,7 +1673,6 @@ golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1749,7 +1706,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@@ -2406,35 +2362,28 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
-gopkg.in/go-playground/validator.v9 v9.30.0 h1:Wk0Z37oBmKj9/n+tPyBHZmeL19LaCoK3Qq48VwYENss=
-gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
-gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0=
+gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M=
+gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/igm/sockjs-go.v3 v3.0.0 h1:8+qYKGEfLE6KsWtVUSo7HIpakcbWneH3ib043MnS4T4=
gopkg.in/igm/sockjs-go.v3 v3.0.0/go.mod h1:4aNFiKYpI9DpJHyToiHfcqxGpWqmjTK9A0FkEwjCizw=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
-gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
-gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -2497,8 +2446,6 @@ k8s.io/metrics v0.29.7/go.mod h1:5AiYPn1Crd25wtTh7OxHg9Rm2t9THSXJVp3Lb2k7MB8=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=
-launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
mellium.im/sasl v0.3.2 h1:PT6Xp7ccn9XaXAnJ03FcEjmAn7kK1x7aoXV6F+Vmrl0=
diff --git a/pkg/commonService/CommonBaseService.go b/pkg/commonService/CommonBaseService.go
index e398266d89..664bb4eb61 100644
--- a/pkg/commonService/CommonBaseService.go
+++ b/pkg/commonService/CommonBaseService.go
@@ -75,6 +75,7 @@ func (impl *CommonBaseServiceImpl) EnvironmentVariableList() (*EnvironmentVariab
return environmentVariableList, err
}
environmentVariableList.FeatureGitOpsFlags = featureGitOpsFlags
+ environmentVariableList.IsAirGapEnvironment = impl.globalEnvVariables.GlobalEnvVariables.IsAirGapEnvironment
return environmentVariableList, nil
}
diff --git a/pkg/commonService/bean_ent.go b/pkg/commonService/bean_ent.go
index c04eaf9c68..ec78ebb4ae 100644
--- a/pkg/commonService/bean_ent.go
+++ b/pkg/commonService/bean_ent.go
@@ -17,4 +17,5 @@
package commonService
type EnvironmentVariableListEnt struct {
+ IsAirGapEnvironment bool `json:"isAirGapEnvironment"`
}
diff --git a/pkg/module/ModuleService.go b/pkg/module/ModuleService.go
index e750dc2f60..fd9c50dff5 100644
--- a/pkg/module/ModuleService.go
+++ b/pkg/module/ModuleService.go
@@ -63,12 +63,19 @@ type ModuleServiceImpl struct {
moduleServiceHelper ModuleServiceHelper
moduleResourceStatusRepository moduleRepo.ModuleResourceStatusRepository
scanToolMetadataService scanTool.ScanToolMetadataService
+ globalEnvVariables *util2.GlobalEnvVariables
+ moduleEnvConfig *bean.ModuleEnvConfig
+ installedModulesMap map[string]bool
}
func NewModuleServiceImpl(logger *zap.SugaredLogger, serverEnvConfig *serverEnvConfig.ServerEnvConfig, moduleRepository moduleRepo.ModuleRepository,
moduleActionAuditLogRepository ModuleActionAuditLogRepository, helmAppService client.HelmAppService, serverDataStore *serverDataStore.ServerDataStore, serverCacheService server.ServerCacheService, moduleCacheService ModuleCacheService, moduleCronService ModuleCronService,
moduleServiceHelper ModuleServiceHelper, moduleResourceStatusRepository moduleRepo.ModuleResourceStatusRepository,
- scanToolMetadataService scanTool.ScanToolMetadataService) *ModuleServiceImpl {
+ scanToolMetadataService scanTool.ScanToolMetadataService, envVariables *util2.EnvironmentVariables, moduleEnvConfig *bean.ModuleEnvConfig) *ModuleServiceImpl {
+ installedModulesMap := make(map[string]bool)
+ for _, module := range moduleEnvConfig.InstalledModules {
+ installedModulesMap[module] = true
+ }
return &ModuleServiceImpl{
logger: logger,
serverEnvConfig: serverEnvConfig,
@@ -82,6 +89,9 @@ func NewModuleServiceImpl(logger *zap.SugaredLogger, serverEnvConfig *serverEnvC
moduleServiceHelper: moduleServiceHelper,
moduleResourceStatusRepository: moduleResourceStatusRepository,
scanToolMetadataService: scanToolMetadataService,
+ globalEnvVariables: envVariables.GlobalEnvVariables,
+ moduleEnvConfig: moduleEnvConfig,
+ installedModulesMap: installedModulesMap,
}
}
@@ -180,26 +190,39 @@ func (impl ModuleServiceImpl) GetModuleConfig(name string) (*bean.ModuleConfigDt
return moduleConfig, nil
}
+func (impl ModuleServiceImpl) extractModuleTypeFromModule(moduleName string) (string, error) {
+ var moduleType string
+ if len(impl.installedModulesMap) > 0 {
+ if strings.Contains(moduleName, bean.MODULE_TYPE_SECURITY) {
+ moduleType = bean.MODULE_TYPE_SECURITY
+ }
+ } else {
+ // central-api call
+ moduleMetaData, err := impl.moduleServiceHelper.GetModuleMetadata(moduleName)
+ if err != nil {
+ impl.logger.Errorw("Error in getting module metadata", "moduleName", moduleName, "err", err)
+ return "", err
+ }
+ moduleType = gjson.Get(string(moduleMetaData), "result.moduleType").String()
+ }
+ return moduleType, nil
+}
+
func (impl ModuleServiceImpl) handleModuleNotFoundStatus(moduleName string) (bean.ModuleStatus, string, bool, error) {
// if entry is not found in database, then check if that module is legacy or not
// if enterprise user -> if legacy -> then mark as installed in db and return as installed, if not legacy -> return as not installed
// if non-enterprise user-> fetch helm release enable Key. if true -> then mark as installed in db and return as installed. if false ->
//// (continuation of above line) if legacy -> check if cicd is installed with <= 0.5.3 from DB and moduleName != argo-cd -> then mark as installed in db and return as installed. otherwise return as not installed
-
- // central-api call
- moduleMetaData, err := impl.moduleServiceHelper.GetModuleMetadata(moduleName)
+ moduleType, err := impl.extractModuleTypeFromModule(moduleName)
if err != nil {
- impl.logger.Errorw("Error in getting module metadata", "moduleName", moduleName, "err", err)
+ impl.logger.Errorw("error in handleModuleNotFoundStatus", "moduleName", moduleName, "err", err)
return bean.ModuleStatusNotInstalled, "", false, err
}
- moduleMetaDataStr := string(moduleMetaData)
- isLegacyModule := gjson.Get(moduleMetaDataStr, "result.isIncludedInLegacyFullPackage").Bool()
- moduleType := gjson.Get(moduleMetaDataStr, "result.moduleType").String()
flagForEnablingState := false
flagForActiveTool := false
if moduleType == bean.MODULE_TYPE_SECURITY {
- err = impl.moduleRepository.FindByModuleTypeAndStatus(moduleType, bean.ModuleStatusInstalled)
+ err := impl.moduleRepository.FindByModuleTypeAndStatus(moduleType, bean.ModuleStatusInstalled)
if err != nil {
if err == pg.ErrNoRows {
flagForEnablingState = true
@@ -213,52 +236,56 @@ func (impl ModuleServiceImpl) handleModuleNotFoundStatus(moduleName string) (bea
flagForEnablingState = true
}
- // for enterprise user
- if impl.serverEnvConfig.DevtronInstallationType == serverBean.DevtronInstallationTypeEnterprise {
- if isLegacyModule {
- status, err := impl.saveModuleAsInstalled(moduleName, moduleType, flagForEnablingState)
- return status, moduleType, flagForActiveTool, err
- }
- return bean.ModuleStatusNotInstalled, moduleType, false, nil
- }
- // for non-enterprise user
- devtronHelmAppIdentifier := impl.helmAppService.GetDevtronHelmAppIdentifier()
- releaseInfo, err := impl.helmAppService.GetValuesYaml(context.Background(), devtronHelmAppIdentifier)
- if err != nil {
- impl.logger.Errorw("Error in getting values yaml for devtron operator helm release", "moduleName", moduleName, "err", err)
- apiError := clientErrors.ConvertToApiError(err)
- if apiError != nil {
- err = apiError
- }
- return bean.ModuleStatusNotInstalled, moduleType, false, err
- }
- releaseValues := releaseInfo.MergedValues
-
- // if check non-cicd module status
- if moduleName != bean.ModuleNameCiCd {
- isEnabled := gjson.Get(releaseValues, moduleUtil.BuildModuleEnableKey(moduleName)).Bool()
- if isEnabled {
- status, err := impl.saveModuleAsInstalled(moduleName, moduleType, flagForEnablingState)
- return status, moduleType, flagForActiveTool, err
+ if len(impl.installedModulesMap) == 0 {
+ devtronHelmAppIdentifier := impl.helmAppService.GetDevtronHelmAppIdentifier()
+ releaseInfo, err := impl.helmAppService.GetValuesYaml(context.Background(), devtronHelmAppIdentifier)
+ if err != nil {
+ impl.logger.Errorw("Error in getting values yaml for devtron operator helm release", "moduleName", moduleName, "err", err)
+ apiError := clientErrors.ConvertToApiError(err)
+ if apiError != nil {
+ err = apiError
+ }
+ return bean.ModuleStatusNotInstalled, moduleType, false, err
}
- } else if util2.IsBaseStack() {
- // check if cicd is in installing state
- // if devtron is installed with cicd module, then cicd module should be shown as installing
- installerModulesIface := gjson.Get(releaseValues, bean.INSTALLER_MODULES_HELM_KEY).Value()
- if installerModulesIface != nil {
- installerModulesIfaceKind := reflect.TypeOf(installerModulesIface).Kind()
- if installerModulesIfaceKind == reflect.Slice {
- installerModules := installerModulesIface.([]interface{})
- for _, installerModule := range installerModules {
- if installerModule == moduleName {
- status, err := impl.saveModule(moduleName, bean.ModuleStatusInstalling, moduleType, flagForEnablingState)
- return status, moduleType, false, err
+ releaseValues := releaseInfo.MergedValues
+
+ // if check non-cicd module status
+ if moduleName != bean.ModuleNameCiCd {
+ isEnabled := gjson.Get(releaseValues, moduleUtil.BuildModuleEnableKey(moduleName)).Bool()
+ if isEnabled {
+ status, err := impl.saveModuleAsInstalled(moduleName, moduleType, flagForEnablingState)
+ return status, moduleType, flagForActiveTool, err
+ }
+ } else if util2.IsBaseStack() {
+ // check if cicd is in installing state
+ // if devtron is installed with cicd module, then cicd module should be shown as installing
+ installerModulesIface := gjson.Get(releaseValues, bean.INSTALLER_MODULES_HELM_KEY).Value()
+ if installerModulesIface != nil {
+ installerModulesIfaceKind := reflect.TypeOf(installerModulesIface).Kind()
+ if installerModulesIfaceKind == reflect.Slice {
+ installerModules := installerModulesIface.([]interface{})
+ for _, installerModule := range installerModules {
+ if installerModule == moduleName {
+ status, err := impl.saveModule(moduleName, bean.ModuleStatusInstalling, moduleType, flagForEnablingState)
+ return status, moduleType, false, err
+ }
}
+ } else {
+ impl.logger.Warnw("Invalid installerModulesIfaceKind expected slice", "installerModulesIfaceKind", installerModulesIfaceKind, "val", installerModulesIface)
}
- } else {
- impl.logger.Warnw("Invalid installerModulesIfaceKind expected slice", "installerModulesIfaceKind", installerModulesIfaceKind, "val", installerModulesIface)
}
}
+ } else {
+ if _, ok := impl.installedModulesMap[moduleName]; !ok {
+ return bean.ModuleStatusNotInstalled, moduleType, false, nil
+ }
+ if moduleName != bean.ModuleNameCiCd {
+ status, err := impl.saveModuleAsInstalled(moduleName, moduleType, flagForEnablingState)
+ return status, moduleType, flagForActiveTool, err
+ } else if util2.IsBaseStack() {
+ status, err := impl.saveModule(moduleName, bean.ModuleStatusInstalling, moduleType, flagForEnablingState)
+ return status, moduleType, false, err
+ }
}
return bean.ModuleStatusNotInstalled, moduleType, false, nil
diff --git a/pkg/module/bean/bean.go b/pkg/module/bean/bean.go
index 2cd5a95ff4..a808ea07ee 100644
--- a/pkg/module/bean/bean.go
+++ b/pkg/module/bean/bean.go
@@ -52,7 +52,8 @@ type ActionResponse struct {
}
type ModuleEnvConfig struct {
- ModuleStatusHandlingCronDurationInMin int `env:"MODULE_STATUS_HANDLING_CRON_DURATION_MIN" envDefault:"3"` // default 3 minutes
+ ModuleStatusHandlingCronDurationInMin int `env:"MODULE_STATUS_HANDLING_CRON_DURATION_MIN" envDefault:"3"` // default 3 minutes
+ InstalledModules []string `env:"INSTALLED_MODULES" envDefault:"" envSeparator:"," description:"List of installed modules given in helm values/yaml are written in cm and used by devtron to know which modules are given" example:"security.trivy,security.clair"`
}
type ModuleResourceStatusDto struct {
diff --git a/scripts/sql/32503200_license_attributes.down.sql b/scripts/sql/32503200_license_attributes.down.sql
new file mode 100644
index 0000000000..982fd3d6a2
--- /dev/null
+++ b/scripts/sql/32503200_license_attributes.down.sql
@@ -0,0 +1,8 @@
+BEGIN;
+-- Drop Table: license_attributes
+DROP TABLE IF EXISTS "public"."license_attributes";
+
+-- Drop Sequence: id_seq_license_attributes
+DROP SEQUENCE IF EXISTS id_seq_license_attributes;
+
+COMMIT;
\ No newline at end of file
diff --git a/scripts/sql/32503200_license_attributes.up.sql b/scripts/sql/32503200_license_attributes.up.sql
new file mode 100644
index 0000000000..ac82e5c2a4
--- /dev/null
+++ b/scripts/sql/32503200_license_attributes.up.sql
@@ -0,0 +1,18 @@
+BEGIN;
+-- Sequence
+CREATE SEQUENCE IF NOT EXISTS id_seq_license_attributes;
+
+-- Table Definition
+CREATE TABLE IF NOT EXISTS "public"."license_attributes" (
+ "id" int4 NOT NULL DEFAULT nextval('id_seq_license_attributes'::regclass),
+ "key" varchar(250) NOT NULL,
+ "value" TEXT NOT NULL,
+ "active" bool NOT NULL,
+ "created_on" timestamptz,
+ "created_by" integer,
+ "updated_on" timestamptz,
+ "updated_by" integer,
+ PRIMARY KEY ("id")
+);
+
+COMMIT;
\ No newline at end of file
diff --git a/util/GlobalConfig.go b/util/GlobalConfig.go
index 4a58fae1e9..e46a29175a 100644
--- a/util/GlobalConfig.go
+++ b/util/GlobalConfig.go
@@ -54,6 +54,7 @@ type GlobalEnvVariables struct {
ArgoGitCommitRetryDelayOnConflict int `env:"ARGO_GIT_COMMIT_RETRY_DELAY_ON_CONFLICT" envDefault:"1"`
ExposeCiMetrics bool `env:"EXPOSE_CI_METRICS" envDefault:"false"`
ExecuteWireNilChecker bool `env:"EXECUTE_WIRE_NIL_CHECKER" envDefault:"false"`
+ IsAirGapEnvironment bool `json:"isAirGapEnvironment" env:"IS_AIR_GAP_ENVIRONMENT" envDefault:"false"`
}
type GlobalClusterConfig struct {
diff --git a/vendor/github.com/devtron-labs/authenticator/oidc/oidc.go b/vendor/github.com/devtron-labs/authenticator/oidc/oidc.go
index a44e53c2c4..1bef8c85c4 100644
--- a/vendor/github.com/devtron-labs/authenticator/oidc/oidc.go
+++ b/vendor/github.com/devtron-labs/authenticator/oidc/oidc.go
@@ -235,11 +235,39 @@ func NewClientApp(settings *Settings, cache OIDCStateStorage, baseHRef string, u
return &a, nil
}
-func (a *ClientApp) oauth2Config(scopes []string) (*oauth2.Config, error) {
+func (a *ClientApp) oauth2Config(scopes []string, connectorId string) (*oauth2.Config, error) {
endpoint, err := a.provider.Endpoint()
if err != nil {
return nil, err
}
+ if len(connectorId) > 0 {
+ errored := false
+ authUrl, err := url.JoinPath(endpoint.AuthURL, connectorId)
+ if err != nil {
+ errored = true
+ //using default auth url in case error occurred
+ fmt.Println("error occurred while joining auth url with connectorId", err)
+ }
+
+ deviceAuthURL, err := url.JoinPath(endpoint.DeviceAuthURL, connectorId)
+ if err != nil {
+ errored = true
+ //using default auth url in case error occurred
+ fmt.Println("error occurred while joining auth url with connectorId", err)
+ }
+ tokenURL, err := url.JoinPath(endpoint.TokenURL, connectorId)
+ if err != nil {
+ errored = true
+ //using default auth url in case error occurred
+ fmt.Println("error occurred while joining auth url with connectorId", err)
+ }
+ if !errored {
+ endpoint.AuthURL = authUrl
+ endpoint.DeviceAuthURL = deviceAuthURL
+ endpoint.TokenURL = tokenURL
+ }
+
+ }
return &oauth2.Config{
ClientID: a.clientID,
ClientSecret: a.clientSecret,
@@ -371,7 +399,9 @@ func (a *ClientApp) HandleLogin(w http.ResponseWriter, r *http.Request) {
var opts []oauth2.AuthCodeOption
scopes = a.settings.OIDCConfig.RequestedScopes
opts = AppendClaimsAuthenticationRequestParameter(opts, a.settings.OIDCConfig.RequestedIDTokenClaims)
- oauth2Config, err := a.oauth2Config(GetScopesOrDefault(scopes))
+ v := r.URL.Query()
+ connectorId := v.Get("connectorId")
+ oauth2Config, err := a.oauth2Config(GetScopesOrDefault(scopes), connectorId)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -400,7 +430,7 @@ func (a *ClientApp) HandleLogin(w http.ResponseWriter, r *http.Request) {
// HandleCallback is the callback handler for an OAuth2 login flow
func (a *ClientApp) HandleCallback(w http.ResponseWriter, r *http.Request) {
- oauth2Config, err := a.oauth2Config(nil)
+ oauth2Config, err := a.oauth2Config(nil, "")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
diff --git a/vendor/github.com/devtron-labs/common-lib/constants/InternalErrorCode.go b/vendor/github.com/devtron-labs/common-lib/constants/InternalErrorCode.go
new file mode 100644
index 0000000000..0e807b971d
--- /dev/null
+++ b/vendor/github.com/devtron-labs/common-lib/constants/InternalErrorCode.go
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2020-2024. Devtron Inc.
+ */
+
+package constants
+
+const (
+ UserCreateDBFailed string = "6001"
+ UserCreatePolicyFailed string = "6002"
+ UserUpdateDBFailed string = "6003"
+ UserUpdatePolicyFailed string = "6004"
+ UserNoTokenProvided string = "6005"
+ UserNotFoundForToken string = "6006"
+ UserCreateFetchRoleFailed string = "6007"
+ UserUpdateFetchRoleFailed string = "6008"
+)
diff --git a/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go
index 17222a7498..2313bd7187 100644
--- a/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go
+++ b/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go
@@ -16,7 +16,11 @@
package utils
-import "fmt"
+import (
+ "errors"
+ "fmt"
+ "github.com/go-pg/pg"
+)
type ApiError struct {
HttpStatusCode int `json:"-"`
@@ -39,3 +43,7 @@ func (e *ApiError) ErrorfInternal(format string, a ...interface{}) error {
func (e ApiError) ErrorfUser(format string, a ...interface{}) error {
return &ApiError{InternalMessage: fmt.Sprintf(format, a...)}
}
+
+func IsErrNoRows(err error) bool {
+ return errors.Is(err, pg.ErrNoRows)
+}
diff --git a/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go
index 43ba49795d..933b97f4f9 100644
--- a/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go
+++ b/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go
@@ -19,7 +19,9 @@ package http
import (
"crypto/tls"
"crypto/x509"
+ "encoding/json"
"github.com/pkg/errors"
+ "io/ioutil"
"net/http"
"os"
)
@@ -80,3 +82,29 @@ func CertPoolFromFile(filename string) (*x509.CertPool, error) {
}
return cp, nil
}
+
+func HttpRequest(url string) (map[string]interface{}, error) {
+ req, err := http.NewRequest(http.MethodGet, url, nil)
+ if err != nil {
+ return nil, err
+ }
+ //var client *http.Client
+ client := &http.Client{}
+ res, err := client.Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if res.StatusCode >= 200 && res.StatusCode <= 299 {
+ resBody, err := ioutil.ReadAll(res.Body)
+ if err != nil {
+ return nil, err
+ }
+ var apiRes map[string]interface{}
+ err = json.Unmarshal(resBody, &apiRes)
+ if err != nil {
+ return nil, err
+ }
+ return apiRes, err
+ }
+ return nil, err
+}
diff --git a/vendor/github.com/go-playground/locales/README.md b/vendor/github.com/go-playground/locales/README.md
index 5b0694fd19..7b6be2c647 100644
--- a/vendor/github.com/go-playground/locales/README.md
+++ b/vendor/github.com/go-playground/locales/README.md
@@ -1,10 +1,8 @@
## locales
-

+

[](https://travis-ci.org/go-playground/locales)
-[](https://goreportcard.com/report/github.com/go-playground/locales)
[](https://godoc.org/github.com/go-playground/locales)

-[](https://gitter.im/go-playground/locales?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Locales is a set of locales generated from the [Unicode CLDR Project](http://cldr.unicode.org/) which can be used independently or within
an i18n package; these were built for use with, but not exclusive to, [Universal Translator](https://github.com/go-playground/universal-translator).
diff --git a/vendor/github.com/go-playground/universal-translator/README.md b/vendor/github.com/go-playground/universal-translator/README.md
index 46dec6d2b2..d9b6654741 100644
--- a/vendor/github.com/go-playground/universal-translator/README.md
+++ b/vendor/github.com/go-playground/universal-translator/README.md
@@ -1,11 +1,9 @@
## universal-translator
-

-[](https://travis-ci.org/go-playground/universal-translator)
+

[](https://coveralls.io/github/go-playground/universal-translator)
[](https://goreportcard.com/report/github.com/go-playground/universal-translator)
[](https://godoc.org/github.com/go-playground/universal-translator)

-[](https://gitter.im/go-playground/universal-translator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Universal Translator is an i18n Translator for Go/Golang using CLDR data + pluralization rules
diff --git a/vendor/github.com/go-playground/universal-translator/import_export.go b/vendor/github.com/go-playground/universal-translator/import_export.go
index 1216f19237..87a1b465cb 100644
--- a/vendor/github.com/go-playground/universal-translator/import_export.go
+++ b/vendor/github.com/go-playground/universal-translator/import_export.go
@@ -3,7 +3,6 @@ package ut
import (
"encoding/json"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
@@ -41,7 +40,6 @@ const (
func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) error {
_, err := os.Stat(dirname)
- fmt.Println(dirname, err, os.IsNotExist(err))
if err != nil {
if !os.IsNotExist(err) {
@@ -138,7 +136,7 @@ func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string)
return err
}
- err = ioutil.WriteFile(filepath.Join(dirname, fmt.Sprintf("%s%s", locale.Locale(), ext)), b, 0644)
+ err = os.WriteFile(filepath.Join(dirname, fmt.Sprintf("%s%s", locale.Locale(), ext)), b, 0644)
if err != nil {
return err
}
@@ -200,7 +198,7 @@ func (t *UniversalTranslator) Import(format ImportExportFormat, dirnameOrFilenam
// NOTE: generally used when assets have been embedded into the binary and are already in memory.
func (t *UniversalTranslator) ImportByReader(format ImportExportFormat, reader io.Reader) error {
- b, err := ioutil.ReadAll(reader)
+ b, err := io.ReadAll(reader)
if err != nil {
return err
}
diff --git a/vendor/github.com/juju/errors/Makefile b/vendor/github.com/juju/errors/Makefile
index 38e7c1c25a..a5bc81e66b 100644
--- a/vendor/github.com/juju/errors/Makefile
+++ b/vendor/github.com/juju/errors/Makefile
@@ -17,7 +17,7 @@ check-go:
echo go fmt is sad: $(GOFMT); \
exit 1; \
fi )
- @(go tool vet -all -composites=false -copylocks=false .)
+ @(go vet -all -composites=false -copylocks=false .)
docs:
godoc2md github.com/juju/errors > README.md
diff --git a/vendor/github.com/juju/errors/dependencies.tsv b/vendor/github.com/juju/errors/dependencies.tsv
deleted file mode 100644
index e324344944..0000000000
--- a/vendor/github.com/juju/errors/dependencies.tsv
+++ /dev/null
@@ -1,5 +0,0 @@
-github.com/juju/loggo git 8232ab8918d91c72af1a9fb94d3edbe31d88b790 2017-06-05T01:46:07Z
-github.com/juju/testing git 72703b1e95eb8ce4737fd8a3d8496c6b0be280a6 2018-05-17T13:41:05Z
-gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z
-gopkg.in/mgo.v2 git f2b6f6c918c452ad107eec89615f074e3bd80e33 2016-08-18T01:52:18Z
-gopkg.in/yaml.v2 git 1be3d31502d6eabc0dd7ce5b0daab022e14a5538 2017-07-12T05:45:46Z
diff --git a/vendor/github.com/juju/errors/error.go b/vendor/github.com/juju/errors/error.go
index 2796b9f29b..326b917a90 100644
--- a/vendor/github.com/juju/errors/error.go
+++ b/vendor/github.com/juju/errors/error.go
@@ -6,7 +6,6 @@ package errors
import (
"fmt"
"reflect"
- "runtime"
)
// Err holds a description of an error along with information about
@@ -25,12 +24,60 @@ type Err struct {
// previous holds the previous error in the error stack, if any.
previous error
- // file and line hold the source code location where the error was
- // created.
- file string
+ // function is the package path-qualified function name where the
+ // error was created.
+ function string
+
+ // line is the line number the error was created on inside of function
+ line int
+}
+
+// Locationer is an interface that represents a certain class of errors that
+// contain the location information from where they were raised.
+type Locationer interface {
+ // Location returns the path-qualified function name where the error was
+ // created and the line number
+ Location() (function string, line int)
+}
+
+// locationError is the internal implementation of the Locationer interface.
+type locationError struct {
+ error
+
+ // function is the package path-qualified function name where the
+ // error was created.
+ function string
+
+ // line is the line number the error was created on inside of function
line int
}
+// newLocationError constructs a new Locationer error from the supplied error
+// with the location set to callDepth in the stack. If a nill error is provided
+// to this function then a new empty error is constructed.
+func newLocationError(err error, callDepth int) *locationError {
+ le := &locationError{error: err}
+ le.function, le.line = getLocation(callDepth + 1)
+ return le
+}
+
+// Error implementes the error interface.
+func (l *locationError) Error() string {
+ if l.error == nil {
+ return ""
+ }
+ return l.error.Error()
+}
+
+// *locationError implements Locationer.Location interface
+func (l *locationError) Location() (string, int) {
+ return l.function, l.line
+}
+
+func (l *locationError) Unwrap() error {
+ return l.error
+}
+
// NewErr is used to return an Err for the purpose of embedding in other
// structures. The location is not specified, and needs to be set with a call
// to SetLocation.
@@ -75,10 +122,10 @@ func NewErrWithCause(other error, format string, args ...interface{}) Err {
}
}
-// Location is the file and line of where the error was most recently
-// created or annotated.
-func (e *Err) Location() (filename string, line int) {
- return e.file, e.line
+// Location returns the package path-qualified function name and line of where
+// the error was most recently created or annotated.
+func (e *Err) Location() (function string, line int) {
+ return e.function, e.line
}
// Underlying returns the previous error in the error stack, if any. A client
@@ -155,12 +202,10 @@ type unformatter Err
func (unformatter) Format() { /* break the fmt.Formatter interface */ }
-// SetLocation records the source location of the error at callDepth stack
-// frames above the call.
+// SetLocation records the package path-qualified function name of the error at
+// callDepth stack frames above the call.
func (e *Err) SetLocation(callDepth int) {
- _, file, line, _ := runtime.Caller(callDepth + 1)
- e.file = trimSourcePath(file)
- e.line = line
+ e.function, e.line = getLocation(callDepth + 1)
}
// StackTrace returns one string for each location recorded in the stack of
@@ -174,3 +219,9 @@ func (e *Err) StackTrace() []string {
func sameError(e1, e2 error) bool {
return reflect.DeepEqual(e1, e2)
}
+
+// Unwrap is a synonym for Underlying, which allows Err to be used with the
+// Unwrap, Is and As functions in Go's standard `errors` library.
+func (e *Err) Unwrap() error {
+ return e.previous
+}
diff --git a/vendor/github.com/juju/errors/errortypes.go b/vendor/github.com/juju/errors/errortypes.go
index 119b47c10b..0029f91d12 100644
--- a/vendor/github.com/juju/errors/errortypes.go
+++ b/vendor/github.com/juju/errors/errortypes.go
@@ -4,354 +4,470 @@
package errors
import (
+ "errors"
+ stderror "errors"
"fmt"
+ "strings"
)
-// wrap is a helper to construct an *wrapper.
-func wrap(err error, format, suffix string, args ...interface{}) Err {
- newErr := Err{
- message: fmt.Sprintf(format+suffix, args...),
- previous: err,
+// a ConstError is a prototype for a certain type of error
+type ConstError string
+
+// ConstError implements error
+func (e ConstError) Error() string {
+ return string(e)
+}
+
+// Different types of errors
+const (
+ // Timeout represents an error on timeout.
+ Timeout = ConstError("timeout")
+ // NotFound represents an error when something has not been found.
+ NotFound = ConstError("not found")
+ // UserNotFound represents an error when a non-existent user is looked up.
+ UserNotFound = ConstError("user not found")
+ // Unauthorized represents an error when an operation is unauthorized.
+ Unauthorized = ConstError("unauthorized")
+ // NotImplemented represents an error when something is not
+ // implemented.
+ NotImplemented = ConstError("not implemented")
+ // AlreadyExists represents and error when something already exists.
+ AlreadyExists = ConstError("already exists")
+ // NotSupported represents an error when something is not supported.
+ NotSupported = ConstError("not supported")
+ // NotValid represents an error when something is not valid.
+ NotValid = ConstError("not valid")
+ // NotProvisioned represents an error when something is not yet provisioned.
+ NotProvisioned = ConstError("not provisioned")
+ // NotAssigned represents an error when something is not yet assigned to
+ // something else.
+ NotAssigned = ConstError("not assigned")
+ // BadRequest represents an error when a request has bad parameters.
+ BadRequest = ConstError("bad request")
+ // MethodNotAllowed represents an error when an HTTP request
+ // is made with an inappropriate method.
+ MethodNotAllowed = ConstError("method not allowed")
+ // Forbidden represents an error when a request cannot be completed because of
+ // missing privileges.
+ Forbidden = ConstError("forbidden")
+ // QuotaLimitExceeded is emitted when an action failed due to a quota limit check.
+ QuotaLimitExceeded = ConstError("quota limit exceeded")
+ // NotYetAvailable is the error returned when a resource is not yet available
+ // but it might be in the future.
+ NotYetAvailable = ConstError("not yet available")
+)
+
+// errWithType is an Err bundled with its error type (a ConstError)
+type errWithType struct {
+ error
+ errType ConstError
+}
+
+// Is compares `target` with e's error type
+func (e *errWithType) Is(target error) bool {
+ if &e.errType == nil {
+ return false
}
- newErr.SetLocation(2)
- return newErr
+ return target == e.errType
}
-// timeout represents an error on timeout.
-type timeout struct {
- Err
+// Unwrap an errWithType gives the underlying Err
+func (e *errWithType) Unwrap() error {
+ return e.error
+}
+
+func wrapErrorWithMsg(err error, msg string) error {
+ if err == nil {
+ return stderror.New(msg)
+ }
+ if msg == "" {
+ return err
+ }
+ return fmt.Errorf("%s: %w", msg, err)
}
-// Timeoutf returns an error which satisfies IsTimeout().
+func makeWrappedConstError(err error, format string, args ...interface{}) error {
+ separator := " "
+ if err.Error() == "" || errors.Is(err, &fmtNoop{}) {
+ separator = ""
+ }
+ return fmt.Errorf(strings.Join([]string{format, "%w"}, separator), append(args, err)...)
+}
+
+// WithType is responsible for annotating an already existing error so that it
+// also satisfies that of a ConstError. The resultant error returned should
+// satisfy Is(err, errType). If err is nil then a nil error will also be returned.
+//
+// Now with Go's Is, As and Unwrap support it no longer makes sense to Wrap()
+// 2 errors as both of those errors could be chains of errors in their own right.
+// WithType aims to solve some of the usefulness of Wrap with the ability to
+// make a pre-existing error also satisfy a ConstError type.
+func WithType(err error, errType ConstError) error {
+ if err == nil {
+ return nil
+ }
+ return &errWithType{
+ error: err,
+ errType: errType,
+ }
+}
+
+// Timeoutf returns an error which satisfies Is(err, Timeout) and the Locationer
+// interface.
func Timeoutf(format string, args ...interface{}) error {
- return &timeout{wrap(nil, format, " timeout", args...)}
+ return newLocationError(
+ makeWrappedConstError(Timeout, format, args...),
+ 1,
+ )
}
-// NewTimeout returns an error which wraps err that satisfies
-// IsTimeout().
+// NewTimeout returns an error which wraps err and satisfies Is(err, Timeout)
+// and the Locationer interface.
func NewTimeout(err error, msg string) error {
- return &timeout{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: Timeout,
+ }
}
-// IsTimeout reports whether err was created with Timeoutf() or
-// NewTimeout().
+// Deprecated: IsTimeout reports whether err is a Timeout error. Use
+// Is(err, Timeout).
func IsTimeout(err error) bool {
- err = Cause(err)
- _, ok := err.(*timeout)
- return ok
-}
-
-// notFound represents an error when something has not been found.
-type notFound struct {
- Err
+ return Is(err, Timeout)
}
-// NotFoundf returns an error which satisfies IsNotFound().
+// NotFoundf returns an error which satisfies Is(err, NotFound) and the
+// Locationer interface.
func NotFoundf(format string, args ...interface{}) error {
- return ¬Found{wrap(nil, format, " not found", args...)}
+ return newLocationError(
+ makeWrappedConstError(NotFound, format, args...),
+ 1,
+ )
}
-// NewNotFound returns an error which wraps err that satisfies
-// IsNotFound().
+// NewNotFound returns an error which wraps err and satisfies Is(err, NotFound)
+// and the Locationer interface.
func NewNotFound(err error, msg string) error {
- return ¬Found{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotFound,
+ }
}
-// IsNotFound reports whether err was created with NotFoundf() or
-// NewNotFound().
+// Deprecated: IsNotFound reports whether err is a NotFound error. Use
+// Is(err, NotFound).
func IsNotFound(err error) bool {
- err = Cause(err)
- _, ok := err.(*notFound)
- return ok
-}
-
-// userNotFound represents an error when an inexistent user is looked up.
-type userNotFound struct {
- Err
+ return Is(err, NotFound)
}
-// UserNotFoundf returns an error which satisfies IsUserNotFound().
+// UserNotFoundf returns an error which satisfies Is(err, UserNotFound) and the
+// Locationer interface.
func UserNotFoundf(format string, args ...interface{}) error {
- return &userNotFound{wrap(nil, format, " user not found", args...)}
+ return newLocationError(
+ makeWrappedConstError(UserNotFound, format, args...),
+ 1,
+ )
}
// NewUserNotFound returns an error which wraps err and satisfies
-// IsUserNotFound().
+// Is(err, UserNotFound) and the Locationer interface.
func NewUserNotFound(err error, msg string) error {
- return &userNotFound{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: UserNotFound,
+ }
}
-// IsUserNotFound reports whether err was created with UserNotFoundf() or
-// NewUserNotFound().
+// Deprecated: IsUserNotFound reports whether err is a UserNotFound error. Use
+// Is(err, UserNotFound).
func IsUserNotFound(err error) bool {
- err = Cause(err)
- _, ok := err.(*userNotFound)
- return ok
-}
-
-// unauthorized represents an error when an operation is unauthorized.
-type unauthorized struct {
- Err
+ return Is(err, UserNotFound)
}
-// Unauthorizedf returns an error which satisfies IsUnauthorized().
+// Unauthorizedf returns an error that satisfies Is(err, Unauthorized) and
+// the Locationer interface.
func Unauthorizedf(format string, args ...interface{}) error {
- return &unauthorized{wrap(nil, format, "", args...)}
+ return newLocationError(
+ makeWrappedConstError(Hide(Unauthorized), format, args...),
+ 1,
+ )
}
// NewUnauthorized returns an error which wraps err and satisfies
-// IsUnauthorized().
+// Is(err, Unathorized) and the Locationer interface.
func NewUnauthorized(err error, msg string) error {
- return &unauthorized{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: Unauthorized,
+ }
}
-// IsUnauthorized reports whether err was created with Unauthorizedf() or
-// NewUnauthorized().
+// Deprecated: IsUnauthorized reports whether err is a Unauthorized error. Use
+// Is(err, Unauthorized).
func IsUnauthorized(err error) bool {
- err = Cause(err)
- _, ok := err.(*unauthorized)
- return ok
+ return Is(err, Unauthorized)
}
-// notImplemented represents an error when something is not
-// implemented.
-type notImplemented struct {
- Err
-}
-
-// NotImplementedf returns an error which satisfies IsNotImplemented().
+// NotImplementedf returns an error which satisfies Is(err, NotImplemented) and
+// the Locationer interface.
func NotImplementedf(format string, args ...interface{}) error {
- return ¬Implemented{wrap(nil, format, " not implemented", args...)}
+ return newLocationError(
+ makeWrappedConstError(NotImplemented, format, args...),
+ 1,
+ )
}
// NewNotImplemented returns an error which wraps err and satisfies
-// IsNotImplemented().
+// Is(err, NotImplemented) and the Locationer interface.
func NewNotImplemented(err error, msg string) error {
- return ¬Implemented{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotImplemented,
+ }
}
-// IsNotImplemented reports whether err was created with
-// NotImplementedf() or NewNotImplemented().
+// Deprecated: IsNotImplemented reports whether err is a NotImplemented error.
+// Use Is(err, NotImplemented).
func IsNotImplemented(err error) bool {
- err = Cause(err)
- _, ok := err.(*notImplemented)
- return ok
+ return Is(err, NotImplemented)
}
-// alreadyExists represents and error when something already exists.
-type alreadyExists struct {
- Err
-}
-
-// AlreadyExistsf returns an error which satisfies IsAlreadyExists().
+// AlreadyExistsf returns an error which satisfies Is(err, AlreadyExists) and
+// the Locationer interface.
func AlreadyExistsf(format string, args ...interface{}) error {
- return &alreadyExists{wrap(nil, format, " already exists", args...)}
+ return newLocationError(
+ makeWrappedConstError(AlreadyExists, format, args...),
+ 1,
+ )
}
// NewAlreadyExists returns an error which wraps err and satisfies
-// IsAlreadyExists().
+// Is(err, AlreadyExists) and the Locationer interface.
func NewAlreadyExists(err error, msg string) error {
- return &alreadyExists{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: AlreadyExists,
+ }
}
-// IsAlreadyExists reports whether the error was created with
-// AlreadyExistsf() or NewAlreadyExists().
+// Deprecated: IsAlreadyExists reports whether the err is a AlreadyExists
+// error. Use Is(err, AlreadyExists).
func IsAlreadyExists(err error) bool {
- err = Cause(err)
- _, ok := err.(*alreadyExists)
- return ok
-}
-
-// notSupported represents an error when something is not supported.
-type notSupported struct {
- Err
+ return Is(err, AlreadyExists)
}
-// NotSupportedf returns an error which satisfies IsNotSupported().
+// NotSupportedf returns an error which satisfies Is(err, NotSupported) and the
+// Locationer interface.
func NotSupportedf(format string, args ...interface{}) error {
- return ¬Supported{wrap(nil, format, " not supported", args...)}
+ return newLocationError(
+ makeWrappedConstError(NotSupported, format, args...),
+ 1,
+ )
}
-// NewNotSupported returns an error which wraps err and satisfies
-// IsNotSupported().
+// NewNotSupported returns an error which satisfies Is(err, NotSupported) and
+// the Locationer interface.
func NewNotSupported(err error, msg string) error {
- return ¬Supported{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotSupported,
+ }
}
-// IsNotSupported reports whether the error was created with
-// NotSupportedf() or NewNotSupported().
+// Deprecated: IsNotSupported reports whether err is a NotSupported error. Use
+// Is(err, NotSupported).
func IsNotSupported(err error) bool {
- err = Cause(err)
- _, ok := err.(*notSupported)
- return ok
-}
-
-// notValid represents an error when something is not valid.
-type notValid struct {
- Err
+ return Is(err, NotSupported)
}
-// NotValidf returns an error which satisfies IsNotValid().
+// NotValidf returns an error which satisfies Is(err, NotValid) and the
+// Locationer interface.
func NotValidf(format string, args ...interface{}) error {
- return ¬Valid{wrap(nil, format, " not valid", args...)}
+ return newLocationError(
+ makeWrappedConstError(NotValid, format, args...),
+ 1,
+ )
}
-// NewNotValid returns an error which wraps err and satisfies IsNotValid().
+// NewNotValid returns an error which wraps err and satisfies Is(err, NotValid)
+// and the Locationer interface.
func NewNotValid(err error, msg string) error {
- return ¬Valid{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotValid,
+ }
}
-// IsNotValid reports whether the error was created with NotValidf() or
-// NewNotValid().
+// Deprecated: IsNotValid reports whether err is a NotValid error. Use
+// Is(err, NotValid).
func IsNotValid(err error) bool {
- err = Cause(err)
- _, ok := err.(*notValid)
- return ok
-}
-
-// notProvisioned represents an error when something is not yet provisioned.
-type notProvisioned struct {
- Err
+ return Is(err, NotValid)
}
-// NotProvisionedf returns an error which satisfies IsNotProvisioned().
+// NotProvisionedf returns an error which satisfies Is(err, NotProvisioned) and
+// the Locationer interface.
func NotProvisionedf(format string, args ...interface{}) error {
- return ¬Provisioned{wrap(nil, format, " not provisioned", args...)}
+ return newLocationError(
+ makeWrappedConstError(NotProvisioned, format, args...),
+ 1,
+ )
}
-// NewNotProvisioned returns an error which wraps err that satisfies
-// IsNotProvisioned().
+// NewNotProvisioned returns an error which wraps err and satisfies
+// Is(err, NotProvisioned) and the Locationer interface.
func NewNotProvisioned(err error, msg string) error {
- return ¬Provisioned{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotProvisioned,
+ }
}
-// IsNotProvisioned reports whether err was created with NotProvisionedf() or
-// NewNotProvisioned().
+// Deprecated: IsNotProvisioned reports whether err is a NotProvisioned error.
+// Use Is(err, NotProvisioned).
func IsNotProvisioned(err error) bool {
- err = Cause(err)
- _, ok := err.(*notProvisioned)
- return ok
+ return Is(err, NotProvisioned)
}
-// notAssigned represents an error when something is not yet assigned to
-// something else.
-type notAssigned struct {
- Err
-}
-
-// NotAssignedf returns an error which satisfies IsNotAssigned().
+// NotAssignedf returns an error which satisfies Is(err, NotAssigned) and the
+// Locationer interface.
func NotAssignedf(format string, args ...interface{}) error {
- return ¬Assigned{wrap(nil, format, " not assigned", args...)}
+ return newLocationError(
+ makeWrappedConstError(NotAssigned, format, args...),
+ 1,
+ )
}
-// NewNotAssigned returns an error which wraps err that satisfies
-// IsNotAssigned().
+// NewNotAssigned returns an error which wraps err and satisfies
+// Is(err, NotAssigned) and the Locationer interface.
func NewNotAssigned(err error, msg string) error {
- return ¬Assigned{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotAssigned,
+ }
}
-// IsNotAssigned reports whether err was created with NotAssignedf() or
-// NewNotAssigned().
+// Deprecated: IsNotAssigned reports whether err is a NotAssigned error.
+// Use Is(err, NotAssigned)
func IsNotAssigned(err error) bool {
- err = Cause(err)
- _, ok := err.(*notAssigned)
- return ok
+ return Is(err, NotAssigned)
}
-// badRequest represents an error when a request has bad parameters.
-type badRequest struct {
- Err
-}
-
-// BadRequestf returns an error which satisfies IsBadRequest().
+// BadRequestf returns an error which satisfies Is(err, BadRequest) and the
+// Locationer interface.
func BadRequestf(format string, args ...interface{}) error {
- return &badRequest{wrap(nil, format, "", args...)}
+ return newLocationError(
+ makeWrappedConstError(Hide(BadRequest), format, args...),
+ 1,
+ )
}
-// NewBadRequest returns an error which wraps err that satisfies
-// IsBadRequest().
+// NewBadRequest returns an error which wraps err and satisfies
+// Is(err, BadRequest) and the Locationer interface.
func NewBadRequest(err error, msg string) error {
- return &badRequest{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: BadRequest,
+ }
}
-// IsBadRequest reports whether err was created with BadRequestf() or
-// NewBadRequest().
+// Deprecated: IsBadRequest reports whether err is a BadRequest error.
+// Use Is(err, BadRequest)
func IsBadRequest(err error) bool {
- err = Cause(err)
- _, ok := err.(*badRequest)
- return ok
-}
-
-// methodNotAllowed represents an error when an HTTP request
-// is made with an inappropriate method.
-type methodNotAllowed struct {
- Err
+ return Is(err, BadRequest)
}
-// MethodNotAllowedf returns an error which satisfies IsMethodNotAllowed().
+// MethodNotAllowedf returns an error which satisfies Is(err, MethodNotAllowed)
+// and the Locationer interface.
func MethodNotAllowedf(format string, args ...interface{}) error {
- return &methodNotAllowed{wrap(nil, format, "", args...)}
+ return newLocationError(
+ makeWrappedConstError(Hide(MethodNotAllowed), format, args...),
+ 1,
+ )
}
-// NewMethodNotAllowed returns an error which wraps err that satisfies
-// IsMethodNotAllowed().
+// NewMethodNotAllowed returns an error which wraps err and satisfies
+// Is(err, MethodNotAllowed) and the Locationer interface.
func NewMethodNotAllowed(err error, msg string) error {
- return &methodNotAllowed{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: MethodNotAllowed,
+ }
}
-// IsMethodNotAllowed reports whether err was created with MethodNotAllowedf() or
-// NewMethodNotAllowed().
+// Deprecated: IsMethodNotAllowed reports whether err is a MethodNotAllowed
+// error. Use Is(err, MethodNotAllowed)
func IsMethodNotAllowed(err error) bool {
- err = Cause(err)
- _, ok := err.(*methodNotAllowed)
- return ok
-}
-
-// forbidden represents an error when a request cannot be completed because of
-// missing privileges
-type forbidden struct {
- Err
+ return Is(err, MethodNotAllowed)
}
-// Forbiddenf returns an error which satistifes IsForbidden()
+// Forbiddenf returns an error which satistifes Is(err, Forbidden) and the
+// Locationer interface.
func Forbiddenf(format string, args ...interface{}) error {
- return &forbidden{wrap(nil, format, "", args...)}
+ return newLocationError(
+ makeWrappedConstError(Hide(Forbidden), format, args...),
+ 1,
+ )
}
-// NewForbidden returns an error which wraps err that satisfies
-// IsForbidden().
+// NewForbidden returns an error which wraps err and satisfies
+// Is(err, Forbidden) and the Locationer interface.
func NewForbidden(err error, msg string) error {
- return &forbidden{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: Forbidden,
+ }
}
-// IsForbidden reports whether err was created with Forbiddenf() or
-// NewForbidden().
+// Deprecated: IsForbidden reports whether err is a Forbidden error. Use
+// Is(err, Forbidden).
func IsForbidden(err error) bool {
- err = Cause(err)
- _, ok := err.(*forbidden)
- return ok
-}
-
-// quotaLimitExceeded is emitted when an action failed due to a quota limit check.
-type quotaLimitExceeded struct {
- Err
+ return Is(err, Forbidden)
}
-// QuotaLimitExceededf returns an error which satisfies IsQuotaLimitExceeded.
+// QuotaLimitExceededf returns an error which satisfies
+// Is(err, QuotaLimitExceeded) and the Locationer interface.
func QuotaLimitExceededf(format string, args ...interface{}) error {
- return "aLimitExceeded{wrap(nil, format, "", args...)}
+ return newLocationError(
+ makeWrappedConstError(Hide(QuotaLimitExceeded), format, args...),
+ 1,
+ )
}
// NewQuotaLimitExceeded returns an error which wraps err and satisfies
-// IsQuotaLimitExceeded.
+// Is(err, QuotaLimitExceeded) and the Locationer interface.
func NewQuotaLimitExceeded(err error, msg string) error {
- return "aLimitExceeded{wrap(err, msg, "")}
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: QuotaLimitExceeded,
+ }
}
-// IsQuotaLimitExceeded returns true if the given error represents a
-// QuotaLimitExceeded error.
+// Deprecated: IsQuotaLimitExceeded reports whether err is a QuoteLimitExceeded
+// err. Use Is(err, QuotaLimitExceeded).
func IsQuotaLimitExceeded(err error) bool {
- err = Cause(err)
- _, ok := err.(*quotaLimitExceeded)
- return ok
+ return Is(err, QuotaLimitExceeded)
+}
+
+// NotYetAvailablef returns an error which satisfies Is(err, NotYetAvailable)
+// and the Locationer interface.
+func NotYetAvailablef(format string, args ...interface{}) error {
+ return newLocationError(
+ makeWrappedConstError(Hide(NotYetAvailable), format, args...),
+ 1,
+ )
+}
+
+// NewNotYetAvailable returns an error which wraps err and satisfies
+// Is(err, NotYetAvailable) and the Locationer interface.
+func NewNotYetAvailable(err error, msg string) error {
+ return &errWithType{
+ error: newLocationError(wrapErrorWithMsg(err, msg), 1),
+ errType: NotYetAvailable,
+ }
+}
+
+// Deprecated: IsNotYetAvailable reports whether err is a NotYetAvailable err.
+// Use Is(err, NotYetAvailable)
+func IsNotYetAvailable(err error) bool {
+ return Is(err, NotYetAvailable)
}
diff --git a/vendor/github.com/juju/errors/functions.go b/vendor/github.com/juju/errors/functions.go
index 1bf7c9e257..952a6739a4 100644
--- a/vendor/github.com/juju/errors/functions.go
+++ b/vendor/github.com/juju/errors/functions.go
@@ -4,7 +4,9 @@
package errors
import (
+ stderrors "errors"
"fmt"
+ "runtime"
"strings"
)
@@ -32,6 +34,18 @@ func Errorf(format string, args ...interface{}) error {
return err
}
+// getLocation records the package path-qualified function name of the error at
+// callDepth stack frames above the call.
+func getLocation(callDepth int) (string, int) {
+ rpc := make([]uintptr, 1)
+ n := runtime.Callers(callDepth+2, rpc[:])
+ if n < 1 {
+ return "", 0
+ }
+ frame, _ := runtime.CallersFrames(rpc).Next()
+ return frame.Function, frame.Line
+}
+
// Trace adds the location of the Trace call to the stack. The Cause of the
// resulting error is the same as the error parameter. If the other error is
// nil, the result will be nil.
@@ -42,6 +56,7 @@ func Errorf(format string, args ...interface{}) error {
// }
//
func Trace(other error) error {
+ //return SetLocation(other, 2)
if other == nil {
return nil
}
@@ -211,13 +226,9 @@ type wrapper interface {
Underlying() error
}
-type locationer interface {
- Location() (string, int)
-}
-
var (
_ wrapper = (*Err)(nil)
- _ locationer = (*Err)(nil)
+ _ Locationer = (*Err)(nil)
_ causer = (*Err)(nil)
)
@@ -235,7 +246,7 @@ func Details(err error) string {
s = append(s, '[')
for {
s = append(s, '{')
- if err, ok := err.(locationer); ok {
+ if err, ok := err.(Locationer); ok {
file, line := err.Location()
if file != "" {
s = append(s, fmt.Sprintf("%s:%d", file, line)...)
@@ -286,10 +297,9 @@ func errorStack(err error) []string {
var lines []string
for {
var buff []byte
- if err, ok := err.(locationer); ok {
+ if err, ok := err.(Locationer); ok {
file, line := err.Location()
// Strip off the leading GOPATH/src path elements.
- file = trimSourcePath(file)
if file != "" {
buff = append(buff, fmt.Sprintf("%s:%d", file, line)...)
buff = append(buff, ": "...)
@@ -328,3 +338,117 @@ func errorStack(err error) []string {
}
return result
}
+
+// Unwrap is a proxy for the Unwrap function in Go's standard `errors` library
+// (pkg.go.dev/errors).
+func Unwrap(err error) error {
+ return stderrors.Unwrap(err)
+}
+
+// Is is a proxy for the Is function in Go's standard `errors` library
+// (pkg.go.dev/errors).
+func Is(err, target error) bool {
+ return stderrors.Is(err, target)
+}
+
+// HasType is a function wrapper around AsType dropping the where return value
+// from AsType() making a function that can be used like this:
+//
+// return HasType[*MyError](err)
+//
+// Or
+//
+// if HasType[*MyError](err) {}
+func HasType[T error](err error) bool {
+ _, rval := AsType[T](err)
+ return rval
+}
+
+// As is a proxy for the As function in Go's standard `errors` library
+// (pkg.go.dev/errors).
+func As(err error, target interface{}) bool {
+ return stderrors.As(err, target)
+}
+
+// AsType is a convenience method for checking and getting an error from within
+// a chain that is of type T. If no error is found of type T in the chain the
+// zero value of T is returned with false. If an error in the chain implementes
+// As(any) bool then it's As method will be called if it's type is not of type T.
+
+// AsType finds the first error in err's chain that is assignable to type T, and
+// if a match is found, returns that error value and true. Otherwise, it returns
+// T's zero value and false.
+//
+// AsType is equivalent to errors.As, but uses a type parameter and returns
+// the target, to avoid having to define a variable before the call. For
+// example, callers can replace this:
+//
+// var pathError *fs.PathError
+// if errors.As(err, &pathError) {
+// fmt.Println("Failed at path:", pathError.Path)
+// }
+//
+// With:
+//
+// if pathError, ok := errors.AsType[*fs.PathError](err); ok {
+// fmt.Println("Failed at path:", pathError.Path)
+// }
+func AsType[T error](err error) (T, bool) {
+ for err != nil {
+ if e, is := err.(T); is {
+ return e, true
+ }
+ var res T
+ if x, ok := err.(interface{ As(any) bool }); ok && x.As(&res) {
+ return res, true
+ }
+ err = stderrors.Unwrap(err)
+ }
+ var zero T
+ return zero, false
+}
+
+// SetLocation takes a given error and records where in the stack SetLocation
+// was called from and returns the wrapped error with the location information
+// set. The returned error implements the Locationer interface. If err is nil
+// then a nil error is returned.
+func SetLocation(err error, callDepth int) error {
+ if err == nil {
+ return nil
+ }
+
+ return newLocationError(err, callDepth)
+}
+
+// fmtNoop provides an internal type for wrapping errors so they won't be
+// printed in fmt type commands. As this type is used by the Hide function it's
+// expected that error not be nil.
+type fmtNoop struct {
+ error
+}
+
+// Format implements the fmt.Formatter interface so that the error wrapped by
+// fmtNoop will not be printed.
+func (*fmtNoop) Format(_ fmt.State, r rune) {}
+
+// Is implements errors.Is. It useful for us to be able to check if an error
+// chain has fmtNoop for formatting purposes.
+func (f *fmtNoop) Is(err error) bool {
+ _, is := err.(*fmtNoop)
+ return is
+}
+
+// Unwrap implements the errors.Unwrap method returning the error wrapped by
+// fmtNoop.
+func (f *fmtNoop) Unwrap() error {
+ return f.error
+}
+
+// Hide takes an error and silences it's error string from appearing in fmt
+// like
+func Hide(err error) error {
+ if err == nil {
+ return nil
+ }
+ return &fmtNoop{err}
+}
diff --git a/vendor/github.com/juju/errors/path.go b/vendor/github.com/juju/errors/path.go
deleted file mode 100644
index 48968d9054..0000000000
--- a/vendor/github.com/juju/errors/path.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2013, 2014 Canonical Ltd.
-// Licensed under the LGPLv3, see LICENCE file for details.
-
-package errors
-
-import (
- "go/build"
- "os"
- "path/filepath"
- "strings"
- "sync/atomic"
-)
-
-var trimValue atomic.Value
-var trimDefault = filepath.Join(build.Default.GOPATH, "src") + string(os.PathSeparator)
-
-func trimSourcePath(filename string) string {
- prefix := trimDefault
- if v := trimValue.Load(); v != nil {
- prefix = v.(string)
- }
- return strings.TrimPrefix(filename, prefix)
-}
-
-func SetSourceTrimPrefix(s string) string {
- previous := trimDefault
- if v := trimValue.Load(); v != nil {
- previous = v.(string)
- }
- trimValue.Store(s)
- return previous
-}
diff --git a/vendor/github.com/leodido/go-urn/.gitignore b/vendor/github.com/leodido/go-urn/.gitignore
index 5bcf4bade0..427454f8f1 100644
--- a/vendor/github.com/leodido/go-urn/.gitignore
+++ b/vendor/github.com/leodido/go-urn/.gitignore
@@ -8,4 +8,6 @@
*.out
*.txt
-vendor/
\ No newline at end of file
+vendor/
+/removecomments
+/snake2camel
\ No newline at end of file
diff --git a/vendor/github.com/leodido/go-urn/.travis.yml b/vendor/github.com/leodido/go-urn/.travis.yml
deleted file mode 100644
index e56cf7cc06..0000000000
--- a/vendor/github.com/leodido/go-urn/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: go
-
-go:
- - 1.9.x
- - 1.10.x
- - 1.11.x
- - 1.12.x
- - 1.13.x
- - tip
-
-before_install:
- - go get -t -v ./...
-
-script:
- - go test -race -coverprofile=coverage.txt -covermode=atomic
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
\ No newline at end of file
diff --git a/vendor/github.com/leodido/go-urn/README.md b/vendor/github.com/leodido/go-urn/README.md
index cc902ec0e3..619475bfbb 100644
--- a/vendor/github.com/leodido/go-urn/README.md
+++ b/vendor/github.com/leodido/go-urn/README.md
@@ -1,22 +1,35 @@
-[](https://travis-ci.org/leodido/go-urn) [](https://codecov.io/gh/leodido/go-urn) [](https://godoc.org/github.com/leodido/go-urn)
+[](https://app.circleci.com/pipelines/github/leodido/go-urn) [](https://codecov.io/gh/leodido/go-urn) [](https://godoc.org/github.com/leodido/go-urn)
**A parser for URNs**.
-> As seen on [RFC 2141](https://tools.ietf.org/html/rfc2141#ref-1).
+> As seen on [RFC 2141](https://datatracker.ietf.org/doc/html/rfc2141), [RFC 7643](https://datatracker.ietf.org/doc/html/rfc7643#section-10), and on [RFC 8141](https://datatracker.ietf.org/doc/html/rfc8141).
[API documentation](https://godoc.org/github.com/leodido/go-urn).
+Starting with version 1.3 this library also supports [RFC 7643 SCIM URNs](https://datatracker.ietf.org/doc/html/rfc7643#section-10).
+
+Starting with version 1.4 this library also supports [RFC 8141 URNs (2017)](https://datatracker.ietf.org/doc/html/rfc8141).
+
## Installation
```
go get github.com/leodido/go-urn
```
+## Features
+
+1. RFC 2141 URNs parsing (default)
+2. RFC 8141 URNs parsing (supersedes RFC 2141)
+3. RFC 7643 SCIM URNs parsing
+4. Normalization as per RFCs
+5. Lexical equivalence as per RFCs
+6. Precise, fine-grained errors
+
## Performances
This implementation results to be really fast.
-Usually below ½ microsecond on my machine[1](#mymachine).
+Usually below 400 ns on my machine[1](#mymachine).
Notice it also performs, while parsing:
@@ -24,32 +37,117 @@ Notice it also performs, while parsing:
2. specific-string normalization
```
-ok/00/urn:a:b______________________________________/-4 20000000 265 ns/op 182 B/op 6 allocs/op
-ok/01/URN:foo:a123,456_____________________________/-4 30000000 296 ns/op 200 B/op 6 allocs/op
-ok/02/urn:foo:a123%2c456___________________________/-4 20000000 331 ns/op 208 B/op 6 allocs/op
-ok/03/urn:ietf:params:scim:schemas:core:2.0:User___/-4 20000000 430 ns/op 280 B/op 6 allocs/op
-ok/04/urn:ietf:params:scim:schemas:extension:enterp/-4 20000000 411 ns/op 312 B/op 6 allocs/op
-ok/05/urn:ietf:params:scim:schemas:extension:enterp/-4 20000000 472 ns/op 344 B/op 6 allocs/op
-ok/06/urn:burnout:nss______________________________/-4 30000000 257 ns/op 192 B/op 6 allocs/op
-ok/07/urn:abcdefghilmnopqrstuvzabcdefghilm:x_______/-4 20000000 375 ns/op 213 B/op 6 allocs/op
-ok/08/urn:urnurnurn:urn____________________________/-4 30000000 265 ns/op 197 B/op 6 allocs/op
-ok/09/urn:ciao:@!=%2c(xyz)+a,b.*@g=$_'_____________/-4 20000000 307 ns/op 248 B/op 6 allocs/op
-ok/10/URN:x:abc%1dz%2f%3az_________________________/-4 30000000 259 ns/op 212 B/op 6 allocs/op
-no/11/URN:-xxx:x___________________________________/-4 20000000 445 ns/op 320 B/op 6 allocs/op
-no/12/urn::colon:nss_______________________________/-4 20000000 461 ns/op 320 B/op 6 allocs/op
-no/13/urn:abcdefghilmnopqrstuvzabcdefghilmn:specifi/-4 10000000 660 ns/op 320 B/op 6 allocs/op
-no/14/URN:a!?:x____________________________________/-4 20000000 507 ns/op 320 B/op 6 allocs/op
-no/15/urn:urn:NSS__________________________________/-4 20000000 429 ns/op 288 B/op 6 allocs/op
-no/16/urn:white_space:NSS__________________________/-4 20000000 482 ns/op 320 B/op 6 allocs/op
-no/17/urn:concat:no_spaces_________________________/-4 20000000 539 ns/op 328 B/op 7 allocs/op
-no/18/urn:a:/______________________________________/-4 20000000 470 ns/op 320 B/op 7 allocs/op
-no/19/urn:UrN:NSS__________________________________/-4 20000000 399 ns/op 288 B/op 6 allocs/op
+ok/00/urn:a:b______________________________________/-10 51372006 109.0 ns/op 275 B/op 3 allocs/op
+ok/01/URN:foo:a123,456_____________________________/-10 36024072 160.8 ns/op 296 B/op 6 allocs/op
+ok/02/urn:foo:a123%2C456___________________________/-10 31901007 188.4 ns/op 320 B/op 7 allocs/op
+ok/03/urn:ietf:params:scim:schemas:core:2.0:User___/-10 22736756 266.6 ns/op 376 B/op 6 allocs/op
+ok/04/urn:ietf:params:scim:schemas:extension:enterp/-10 18291859 335.2 ns/op 408 B/op 6 allocs/op
+ok/05/urn:ietf:params:scim:schemas:extension:enterp/-10 15283087 379.4 ns/op 440 B/op 6 allocs/op
+ok/06/urn:burnout:nss______________________________/-10 39407593 155.1 ns/op 288 B/op 6 allocs/op
+ok/07/urn:abcdefghilmnopqrstuvzabcdefghilm:x_______/-10 27832718 211.4 ns/op 307 B/op 4 allocs/op
+ok/08/urn:urnurnurn:urn____________________________/-10 33269596 168.1 ns/op 293 B/op 6 allocs/op
+ok/09/urn:ciao:!!*_________________________________/-10 41100675 148.8 ns/op 288 B/op 6 allocs/op
+ok/10/urn:ciao:=@__________________________________/-10 37214253 149.7 ns/op 284 B/op 6 allocs/op
+ok/11/urn:ciao:@!=%2C(xyz)+a,b.*@g=$_'_____________/-10 26534240 229.8 ns/op 336 B/op 7 allocs/op
+ok/12/URN:x:abc%1Dz%2F%3az_________________________/-10 28166396 211.8 ns/op 336 B/op 7 allocs/op
+no/13/URN:---xxx:x_________________________________/-10 23635159 255.6 ns/op 419 B/op 5 allocs/op
+no/14/urn::colon:nss_______________________________/-10 23594779 258.4 ns/op 419 B/op 5 allocs/op
+no/15/URN:@,:x_____________________________________/-10 23742535 261.5 ns/op 419 B/op 5 allocs/op
+no/16/URN:URN:NSS__________________________________/-10 27432714 223.3 ns/op 371 B/op 5 allocs/op
+no/17/urn:UrN:NSS__________________________________/-10 26922117 224.9 ns/op 371 B/op 5 allocs/op
+no/18/urn:a:%______________________________________/-10 24926733 224.6 ns/op 371 B/op 5 allocs/op
+no/19/urn:urn:NSS__________________________________/-10 27652641 220.7 ns/op 371 B/op 5 allocs/op
+```
+
+* [1]: Apple M1 Pro
+
+
+## Example
+
+For more examples take a look at the [examples file](examples_test.go).
+
+
+```go
+package main
+
+import (
+ "fmt"
+ "github.com/leodido/go-urn"
+)
+
+func main() {
+ var uid = "URN:foo:a123,456"
+
+ // Parse the input string as a RFC 2141 URN only
+ u, e := urn.NewMachine().Parse(uid)
+ if e != nil {
+ fmt.Errorf(err)
+
+ return
+ }
+
+ fmt.Println(u.ID)
+ fmt.Println(u.SS)
+
+ // Output:
+ // foo
+ // a123,456
+}
+```
+
+```go
+package main
+
+import (
+ "fmt"
+ "github.com/leodido/go-urn"
+)
+
+func main() {
+ var uid = "URN:foo:a123,456"
+
+ // Parse the input string as a RFC 2141 URN only
+ u, ok := urn.Parse([]byte(uid))
+ if !ok {
+ panic("error parsing urn")
+ }
+
+ fmt.Println(u.ID)
+ fmt.Println(u.SS)
+
+ // Output:
+ // foo
+ // a123,456
+}
```
----
+```go
+package main
+
+import (
+ "fmt"
+ "github.com/leodido/go-urn"
+)
+
+func main() {
+ input := "urn:ietf:params:scim:api:messages:2.0:ListResponse"
-* [1]: Intel Core i7-7600U CPU @ 2.80GHz
+ // Parsing the input string as a RFC 7643 SCIM URN
+ u, ok := urn.Parse([]byte(input), urn.WithParsingMode(urn.RFC7643Only))
+ if !ok {
+ panic("error parsing urn")
+ }
----
+ fmt.Println(u.IsSCIM())
+ scim := u.SCIM()
+ fmt.Println(scim.Type.String())
+ fmt.Println(scim.Name)
+ fmt.Println(scim.Other)
-[](https://github.com/igrigorik/ga-beacon)
\ No newline at end of file
+ // Output:
+ // true
+ // api
+ // messages
+ // 2.0:ListResponse
+}
+```
\ No newline at end of file
diff --git a/vendor/github.com/leodido/go-urn/kind.go b/vendor/github.com/leodido/go-urn/kind.go
new file mode 100644
index 0000000000..f5e140f0a4
--- /dev/null
+++ b/vendor/github.com/leodido/go-urn/kind.go
@@ -0,0 +1,10 @@
+package urn
+
+type Kind int
+
+const (
+ NONE Kind = iota
+ RFC2141
+ RFC7643
+ RFC8141
+)
diff --git a/vendor/github.com/leodido/go-urn/machine.go b/vendor/github.com/leodido/go-urn/machine.go
index fe5a0cc861..aec1ba69cb 100644
--- a/vendor/github.com/leodido/go-urn/machine.go
+++ b/vendor/github.com/leodido/go-urn/machine.go
@@ -2,27 +2,98 @@ package urn
import (
"fmt"
+
+ scimschema "github.com/leodido/go-urn/scim/schema"
)
var (
- errPrefix = "expecting the prefix to be the \"urn\" string (whatever case) [col %d]"
- errIdentifier = "expecting the identifier to be string (1..31 alnum chars, also containing dashes but not at its start) [col %d]"
- errSpecificString = "expecting the specific string to be a string containing alnum, hex, or others ([()+,-.:=@;$_!*']) chars [col %d]"
- errNoUrnWithinID = "expecting the identifier to not contain the \"urn\" reserved string [col %d]"
- errHex = "expecting the specific string hex chars to be well-formed (%%alnum{2}) [col %d]"
- errParse = "parsing error [col %d]"
+ errPrefix = "expecting the prefix to be the \"urn\" string (whatever case) [col %d]"
+ errIdentifier = "expecting the identifier to be string (1..31 alnum chars, also containing dashes but not at its beginning) [col %d]"
+ errSpecificString = "expecting the specific string to be a string containing alnum, hex, or others ([()+,-.:=@;$_!*']) chars [col %d]"
+ errNoUrnWithinID = "expecting the identifier to not contain the \"urn\" reserved string [col %d]"
+ errHex = "expecting the percent encoded chars to be well-formed (%%alnum{2}) [col %d]"
+ errSCIMNamespace = "expecing the SCIM namespace identifier (ietf:params:scim) [col %d]"
+ errSCIMType = "expecting a correct SCIM type (schemas, api, param) [col %d]"
+ errSCIMName = "expecting one or more alnum char in the SCIM name part [col %d]"
+ errSCIMOther = "expecting a well-formed other SCIM part [col %d]"
+ errSCIMOtherIncomplete = "expecting a not empty SCIM other part after colon [col %d]"
+ err8141InformalID = "informal URN namespace must be in the form urn-[1-9][0-9] [col %d]"
+ err8141SpecificString = "expecting the specific string to contain alnum, hex, or others ([~&()+,-.:=@;$_!*'] or [/?] not in first position) chars [col %d]"
+ err8141Identifier = "expecting the indentifier to be a string with (length 2 to 32 chars) containing alnum (or dashes) not starting or ending with a dash [col %d]"
+ err8141RComponentStart = "expecting only one r-component (starting with the ?+ sequence) [col %d]"
+ err8141QComponentStart = "expecting only one q-component (starting with the ?= sequence) [col %d]"
+ err8141MalformedRComp = "expecting a non-empty r-component containing alnum, hex, or others ([~&()+,-.:=@;$_!*'] or [/?] but not at its beginning) [col %d]"
+ err8141MalformedQComp = "expecting a non-empty q-component containing alnum, hex, or others ([~&()+,-.:=@;$_!*'] or [/?] but not at its beginning) [col %d]"
)
+var _toStateActions []byte = []byte{
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 33, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,
+}
+
+var _eofActions []byte = []byte{
+ 0, 1, 1, 1, 1, 4, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 8, 9,
+ 9, 4, 4, 11, 1, 1, 1, 1,
+ 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 14, 14, 14, 14, 16, 18, 20,
+ 20, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 1, 1, 1, 1, 21,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 23, 24, 24, 25, 25, 0, 26, 28,
+ 28, 29, 29, 30, 30, 26, 26, 31,
+ 31, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 21,
+ 21, 22, 22, 22, 34, 34, 35, 37,
+ 37, 38, 40, 41, 41, 38, 42, 42,
+ 42, 44, 42, 48, 48, 48, 50, 44,
+ 50, 0,
+}
const start int = 1
-const firstFinal int = 44
+const firstFinal int = 172
-const enFail int = 46
+const enScimOnly int = 44
+const enRfc8141Only int = 83
+const enFail int = 193
const enMain int = 1
// Machine is the interface representing the FSM
type Machine interface {
Error() error
Parse(input []byte) (*URN, error)
+ WithParsingMode(ParsingMode)
}
type machine struct {
@@ -30,12 +101,24 @@ type machine struct {
cs int
p, pe, eof, pb int
err error
- tolower []int
+ startParsingAt int
+ parsingMode ParsingMode
+ parsingModeSet bool
}
// NewMachine creates a new FSM able to parse RFC 2141 strings.
-func NewMachine() Machine {
- m := &machine{}
+func NewMachine(options ...Option) Machine {
+ m := &machine{
+ parsingModeSet: false,
+ }
+
+ for _, o := range options {
+ o(m)
+ }
+ // Set default parsing mode
+ if !m.parsingModeSet {
+ m.WithParsingMode(DefaultParsingMode)
+ }
return m
}
@@ -51,7 +134,7 @@ func (m *machine) text() []byte {
return m.data[m.pb:m.p]
}
-// Parse parses the input byte array as a RFC 2141 string.
+// Parse parses the input byte array as a RFC 2141 or RFC7643 string.
func (m *machine) Parse(input []byte) (*URN, error) {
m.data = input
m.p = 0
@@ -59,1622 +142,4881 @@ func (m *machine) Parse(input []byte) (*URN, error) {
m.pe = len(input)
m.eof = len(input)
m.err = nil
- m.tolower = []int{}
- output := &URN{}
-
- {
- m.cs = start
+ m.cs = m.startParsingAt
+ output := &URN{
+ tolower: []int{},
}
-
{
if (m.p) == (m.pe) {
goto _testEof
}
+ if m.cs == 0 {
+ goto _out
+ }
+ _resume:
switch m.cs {
case 1:
- goto stCase1
+ switch (m.data)[(m.p)] {
+ case 85:
+ goto tr1
+ case 117:
+ goto tr1
+ }
+ goto tr0
case 0:
- goto stCase0
+ goto _out
case 2:
- goto stCase2
+ switch (m.data)[(m.p)] {
+ case 82:
+ goto tr2
+ case 114:
+ goto tr2
+ }
+ goto tr0
case 3:
- goto stCase3
+ switch (m.data)[(m.p)] {
+ case 78:
+ goto tr3
+ case 110:
+ goto tr3
+ }
+ goto tr0
case 4:
- goto stCase4
+ if (m.data)[(m.p)] == 58 {
+ goto tr4
+ }
+ goto tr0
case 5:
- goto stCase5
+ switch (m.data)[(m.p)] {
+ case 85:
+ goto tr7
+ case 117:
+ goto tr7
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr6
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr6
+ }
+ default:
+ goto tr6
+ }
+ goto tr5
case 6:
- goto stCase6
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr9
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr9
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr9
+ }
+ default:
+ goto tr9
+ }
+ goto tr8
case 7:
- goto stCase7
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr11
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr11
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr11
+ }
+ default:
+ goto tr11
+ }
+ goto tr8
case 8:
- goto stCase8
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr12
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr12
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr12
+ }
+ default:
+ goto tr12
+ }
+ goto tr8
case 9:
- goto stCase9
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr13
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr13
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr13
+ }
+ default:
+ goto tr13
+ }
+ goto tr8
case 10:
- goto stCase10
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr14
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr14
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr14
+ }
+ default:
+ goto tr14
+ }
+ goto tr8
case 11:
- goto stCase11
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr15
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr15
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr15
+ }
+ default:
+ goto tr15
+ }
+ goto tr8
case 12:
- goto stCase12
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr16
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr16
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr16
+ }
+ default:
+ goto tr16
+ }
+ goto tr8
case 13:
- goto stCase13
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr17
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr17
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr17
+ }
+ default:
+ goto tr17
+ }
+ goto tr8
case 14:
- goto stCase14
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr18
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr18
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr18
+ }
+ default:
+ goto tr18
+ }
+ goto tr8
case 15:
- goto stCase15
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr19
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr19
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr19
+ }
+ default:
+ goto tr19
+ }
+ goto tr8
case 16:
- goto stCase16
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr20
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr20
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr20
+ }
+ default:
+ goto tr20
+ }
+ goto tr8
case 17:
- goto stCase17
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr21
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr21
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr21
+ }
+ default:
+ goto tr21
+ }
+ goto tr8
case 18:
- goto stCase18
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr22
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr22
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr22
+ }
+ default:
+ goto tr22
+ }
+ goto tr8
case 19:
- goto stCase19
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr23
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr23
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr23
+ }
+ default:
+ goto tr23
+ }
+ goto tr8
case 20:
- goto stCase20
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr24
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr24
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr24
+ }
+ default:
+ goto tr24
+ }
+ goto tr8
case 21:
- goto stCase21
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr25
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr25
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr25
+ }
+ default:
+ goto tr25
+ }
+ goto tr8
case 22:
- goto stCase22
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr26
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr26
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr26
+ }
+ default:
+ goto tr26
+ }
+ goto tr8
case 23:
- goto stCase23
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr27
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr27
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr27
+ }
+ default:
+ goto tr27
+ }
+ goto tr8
case 24:
- goto stCase24
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr28
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr28
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr28
+ }
+ default:
+ goto tr28
+ }
+ goto tr8
case 25:
- goto stCase25
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr29
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr29
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr29
+ }
+ default:
+ goto tr29
+ }
+ goto tr8
case 26:
- goto stCase26
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr30
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr30
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr30
+ }
+ default:
+ goto tr30
+ }
+ goto tr8
case 27:
- goto stCase27
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr31
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr31
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr31
+ }
+ default:
+ goto tr31
+ }
+ goto tr8
case 28:
- goto stCase28
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr32
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr32
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr32
+ }
+ default:
+ goto tr32
+ }
+ goto tr8
case 29:
- goto stCase29
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr33
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr33
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr33
+ }
+ default:
+ goto tr33
+ }
+ goto tr8
case 30:
- goto stCase30
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr34
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr34
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr34
+ }
+ default:
+ goto tr34
+ }
+ goto tr8
case 31:
- goto stCase31
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr35
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr35
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr35
+ }
+ default:
+ goto tr35
+ }
+ goto tr8
case 32:
- goto stCase32
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr36
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr36
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr36
+ }
+ default:
+ goto tr36
+ }
+ goto tr8
case 33:
- goto stCase33
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr37
+ case 58:
+ goto tr10
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr37
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr37
+ }
+ default:
+ goto tr37
+ }
+ goto tr8
case 34:
- goto stCase34
- case 35:
- goto stCase35
- case 36:
- goto stCase36
- case 37:
- goto stCase37
- case 38:
- goto stCase38
- case 44:
- goto stCase44
- case 39:
- goto stCase39
- case 40:
- goto stCase40
- case 45:
- goto stCase45
- case 41:
- goto stCase41
- case 42:
- goto stCase42
- case 43:
- goto stCase43
- case 46:
- goto stCase46
- }
- goto stOut
- stCase1:
- switch (m.data)[(m.p)] {
- case 85:
- goto tr1
- case 117:
- goto tr1
- }
- goto tr0
- tr0:
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- tr3:
-
- m.err = fmt.Errorf(errPrefix, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- tr6:
-
- m.err = fmt.Errorf(errIdentifier, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- tr41:
-
- m.err = fmt.Errorf(errSpecificString, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- tr44:
-
- m.err = fmt.Errorf(errHex, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errSpecificString, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- tr50:
-
- m.err = fmt.Errorf(errPrefix, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errIdentifier, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- tr52:
-
- m.err = fmt.Errorf(errNoUrnWithinID, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errIdentifier, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- m.err = fmt.Errorf(errParse, m.p)
- (m.p)--
-
- {
- goto st46
- }
-
- goto st0
- stCase0:
- st0:
- m.cs = 0
- goto _out
- tr1:
-
- m.pb = m.p
-
- goto st2
- st2:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof2
- }
- stCase2:
- switch (m.data)[(m.p)] {
- case 82:
- goto st3
- case 114:
- goto st3
- }
- goto tr0
- st3:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof3
- }
- stCase3:
- switch (m.data)[(m.p)] {
- case 78:
- goto st4
- case 110:
- goto st4
- }
- goto tr3
- st4:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof4
- }
- stCase4:
- if (m.data)[(m.p)] == 58 {
- goto tr5
- }
- goto tr0
- tr5:
-
- output.prefix = string(m.text())
-
- goto st5
- st5:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof5
- }
- stCase5:
- switch (m.data)[(m.p)] {
- case 85:
- goto tr8
- case 117:
- goto tr8
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto tr7
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr38
+ case 58:
+ goto tr10
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto tr7
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr38
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr38
+ }
+ default:
+ goto tr38
}
- default:
- goto tr7
- }
- goto tr6
- tr7:
-
- m.pb = m.p
-
- goto st6
- st6:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof6
- }
- stCase6:
- switch (m.data)[(m.p)] {
- case 45:
- goto st7
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st7
+ goto tr8
+ case 35:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr39
+ case 58:
+ goto tr10
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st7
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr39
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr39
+ }
+ default:
+ goto tr39
}
- default:
- goto st7
- }
- goto tr6
- st7:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof7
- }
- stCase7:
- switch (m.data)[(m.p)] {
- case 45:
- goto st8
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st8
+ goto tr8
+ case 36:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr40
+ case 58:
+ goto tr10
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st8
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr40
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr40
+ }
+ default:
+ goto tr40
}
- default:
- goto st8
- }
- goto tr6
- st8:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof8
- }
- stCase8:
- switch (m.data)[(m.p)] {
- case 45:
- goto st9
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st9
+ goto tr8
+ case 37:
+ if (m.data)[(m.p)] == 58 {
+ goto tr10
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st9
+ goto tr8
+ case 38:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr42
+ case 36:
+ goto tr42
+ case 37:
+ goto tr43
+ case 61:
+ goto tr42
+ case 95:
+ goto tr42
}
- default:
- goto st9
- }
- goto tr6
- st9:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof9
- }
- stCase9:
- switch (m.data)[(m.p)] {
- case 45:
- goto st10
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st10
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr42
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr42
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr42
+ }
+ default:
+ goto tr42
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st10
+ goto tr41
+ case 172:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr212
+ case 36:
+ goto tr212
+ case 37:
+ goto tr213
+ case 61:
+ goto tr212
+ case 95:
+ goto tr212
}
- default:
- goto st10
- }
- goto tr6
- st10:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof10
- }
- stCase10:
- switch (m.data)[(m.p)] {
- case 45:
- goto st11
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st11
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr212
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr212
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr212
+ }
+ default:
+ goto tr212
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st11
+ goto tr41
+ case 39:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr45
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr45
+ }
+ default:
+ goto tr46
}
- default:
- goto st11
- }
- goto tr6
- st11:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof11
- }
- stCase11:
- switch (m.data)[(m.p)] {
- case 45:
- goto st12
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st12
+ goto tr44
+ case 40:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr47
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr47
+ }
+ default:
+ goto tr48
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st12
+ goto tr44
+ case 173:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr212
+ case 36:
+ goto tr212
+ case 37:
+ goto tr213
+ case 61:
+ goto tr212
+ case 95:
+ goto tr212
}
- default:
- goto st12
- }
- goto tr6
- st12:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof12
- }
- stCase12:
- switch (m.data)[(m.p)] {
- case 45:
- goto st13
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st13
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr212
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr212
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr212
+ }
+ default:
+ goto tr212
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st13
+ goto tr44
+ case 41:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr9
+ case 58:
+ goto tr10
+ case 82:
+ goto tr49
+ case 114:
+ goto tr49
}
- default:
- goto st13
- }
- goto tr6
- st13:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof13
- }
- stCase13:
- switch (m.data)[(m.p)] {
- case 45:
- goto st14
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st14
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr9
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr9
+ }
+ default:
+ goto tr9
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st14
+ goto tr5
+ case 42:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr11
+ case 58:
+ goto tr10
+ case 78:
+ goto tr50
+ case 110:
+ goto tr50
}
- default:
- goto st14
- }
- goto tr6
- st14:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof14
- }
- stCase14:
- switch (m.data)[(m.p)] {
- case 45:
- goto st15
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st15
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr11
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr11
+ }
+ default:
+ goto tr11
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st15
+ goto tr5
+ case 43:
+ if (m.data)[(m.p)] == 45 {
+ goto tr12
}
- default:
- goto st15
- }
- goto tr6
- st15:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof15
- }
- stCase15:
- switch (m.data)[(m.p)] {
- case 45:
- goto st16
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st16
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr12
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr12
+ }
+ default:
+ goto tr12
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st16
+ goto tr51
+ case 44:
+ switch (m.data)[(m.p)] {
+ case 85:
+ goto tr52
+ case 117:
+ goto tr52
}
- default:
- goto st16
- }
- goto tr6
- st16:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof16
- }
- stCase16:
- switch (m.data)[(m.p)] {
+ goto tr0
case 45:
- goto st17
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st17
+ switch (m.data)[(m.p)] {
+ case 82:
+ goto tr53
+ case 114:
+ goto tr53
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st17
+ goto tr0
+ case 46:
+ switch (m.data)[(m.p)] {
+ case 78:
+ goto tr54
+ case 110:
+ goto tr54
}
- default:
- goto st17
- }
- goto tr6
- st17:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof17
- }
- stCase17:
- switch (m.data)[(m.p)] {
- case 45:
- goto st18
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st18
+ goto tr0
+ case 47:
+ if (m.data)[(m.p)] == 58 {
+ goto tr55
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st18
+ goto tr0
+ case 48:
+ if (m.data)[(m.p)] == 105 {
+ goto tr57
}
- default:
- goto st18
- }
- goto tr6
- st18:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof18
- }
- stCase18:
- switch (m.data)[(m.p)] {
- case 45:
- goto st19
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st19
+ goto tr56
+ case 49:
+ if (m.data)[(m.p)] == 101 {
+ goto tr58
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st19
+ goto tr56
+ case 50:
+ if (m.data)[(m.p)] == 116 {
+ goto tr59
}
- default:
- goto st19
- }
- goto tr6
- st19:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof19
- }
- stCase19:
- switch (m.data)[(m.p)] {
- case 45:
- goto st20
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st20
+ goto tr56
+ case 51:
+ if (m.data)[(m.p)] == 102 {
+ goto tr60
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st20
+ goto tr56
+ case 52:
+ if (m.data)[(m.p)] == 58 {
+ goto tr61
}
- default:
- goto st20
- }
- goto tr6
- st20:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof20
- }
- stCase20:
- switch (m.data)[(m.p)] {
- case 45:
- goto st21
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st21
+ goto tr56
+ case 53:
+ if (m.data)[(m.p)] == 112 {
+ goto tr62
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st21
+ goto tr56
+ case 54:
+ if (m.data)[(m.p)] == 97 {
+ goto tr63
}
- default:
- goto st21
- }
- goto tr6
- st21:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof21
- }
- stCase21:
- switch (m.data)[(m.p)] {
- case 45:
- goto st22
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st22
+ goto tr56
+ case 55:
+ if (m.data)[(m.p)] == 114 {
+ goto tr64
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st22
+ goto tr56
+ case 56:
+ if (m.data)[(m.p)] == 97 {
+ goto tr65
}
- default:
- goto st22
- }
- goto tr6
- st22:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof22
- }
- stCase22:
- switch (m.data)[(m.p)] {
- case 45:
- goto st23
+ goto tr56
+ case 57:
+ if (m.data)[(m.p)] == 109 {
+ goto tr66
+ }
+ goto tr56
case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st23
+ if (m.data)[(m.p)] == 115 {
+ goto tr67
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st23
+ goto tr56
+ case 59:
+ if (m.data)[(m.p)] == 58 {
+ goto tr68
}
- default:
- goto st23
- }
- goto tr6
- st23:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof23
- }
- stCase23:
- switch (m.data)[(m.p)] {
- case 45:
- goto st24
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st24
+ goto tr56
+ case 60:
+ if (m.data)[(m.p)] == 115 {
+ goto tr69
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st24
+ goto tr56
+ case 61:
+ if (m.data)[(m.p)] == 99 {
+ goto tr70
}
- default:
- goto st24
- }
- goto tr6
- st24:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof24
- }
- stCase24:
- switch (m.data)[(m.p)] {
- case 45:
- goto st25
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st25
+ goto tr56
+ case 62:
+ if (m.data)[(m.p)] == 105 {
+ goto tr71
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st25
+ goto tr56
+ case 63:
+ if (m.data)[(m.p)] == 109 {
+ goto tr72
}
- default:
- goto st25
- }
- goto tr6
- st25:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof25
- }
- stCase25:
- switch (m.data)[(m.p)] {
- case 45:
- goto st26
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st26
+ goto tr56
+ case 64:
+ if (m.data)[(m.p)] == 58 {
+ goto tr73
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st26
+ goto tr56
+ case 65:
+ switch (m.data)[(m.p)] {
+ case 97:
+ goto tr75
+ case 112:
+ goto tr76
+ case 115:
+ goto tr77
}
- default:
- goto st26
- }
- goto tr6
- st26:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof26
- }
- stCase26:
- switch (m.data)[(m.p)] {
- case 45:
- goto st27
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st27
+ goto tr74
+ case 66:
+ if (m.data)[(m.p)] == 112 {
+ goto tr78
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st27
+ goto tr74
+ case 67:
+ if (m.data)[(m.p)] == 105 {
+ goto tr79
}
- default:
- goto st27
- }
- goto tr6
- st27:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof27
- }
- stCase27:
- switch (m.data)[(m.p)] {
- case 45:
- goto st28
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st28
+ goto tr74
+ case 68:
+ if (m.data)[(m.p)] == 58 {
+ goto tr80
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st28
+ goto tr74
+ case 69:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr82
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr82
+ }
+ default:
+ goto tr82
}
- default:
- goto st28
- }
- goto tr6
- st28:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof28
- }
- stCase28:
- switch (m.data)[(m.p)] {
- case 45:
- goto st29
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st29
+ goto tr81
+ case 174:
+ if (m.data)[(m.p)] == 58 {
+ goto tr215
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st29
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr214
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr214
+ }
+ default:
+ goto tr214
}
- default:
- goto st29
- }
- goto tr6
- st29:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof29
- }
- stCase29:
- switch (m.data)[(m.p)] {
- case 45:
- goto st30
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st30
+ goto tr81
+ case 70:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr84
+ case 36:
+ goto tr84
+ case 37:
+ goto tr85
+ case 61:
+ goto tr84
+ case 95:
+ goto tr84
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st30
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr84
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr84
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr84
+ }
+ default:
+ goto tr84
}
- default:
- goto st30
- }
- goto tr6
- st30:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof30
- }
- stCase30:
- switch (m.data)[(m.p)] {
- case 45:
- goto st31
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st31
+ goto tr83
+ case 175:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr216
+ case 36:
+ goto tr216
+ case 37:
+ goto tr217
+ case 61:
+ goto tr216
+ case 95:
+ goto tr216
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st31
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr216
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr216
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr216
+ }
+ default:
+ goto tr216
}
- default:
- goto st31
- }
- goto tr6
- st31:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof31
- }
- stCase31:
- switch (m.data)[(m.p)] {
- case 45:
- goto st32
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st32
+ goto tr83
+ case 71:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr87
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr87
+ }
+ default:
+ goto tr88
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st32
+ goto tr86
+ case 72:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr89
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr89
+ }
+ default:
+ goto tr90
}
- default:
- goto st32
- }
- goto tr6
- st32:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof32
- }
- stCase32:
- switch (m.data)[(m.p)] {
- case 45:
- goto st33
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st33
+ goto tr86
+ case 176:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr216
+ case 36:
+ goto tr216
+ case 37:
+ goto tr217
+ case 61:
+ goto tr216
+ case 95:
+ goto tr216
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st33
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr216
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr216
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr216
+ }
+ default:
+ goto tr216
}
- default:
- goto st33
- }
- goto tr6
- st33:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof33
- }
- stCase33:
- switch (m.data)[(m.p)] {
- case 45:
- goto st34
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st34
+ goto tr86
+ case 73:
+ if (m.data)[(m.p)] == 97 {
+ goto tr91
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st34
+ goto tr74
+ case 74:
+ if (m.data)[(m.p)] == 114 {
+ goto tr92
}
- default:
- goto st34
- }
- goto tr6
- st34:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof34
- }
- stCase34:
- switch (m.data)[(m.p)] {
- case 45:
- goto st35
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st35
+ goto tr74
+ case 75:
+ if (m.data)[(m.p)] == 97 {
+ goto tr93
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st35
+ goto tr74
+ case 76:
+ if (m.data)[(m.p)] == 109 {
+ goto tr79
}
- default:
- goto st35
- }
- goto tr6
- st35:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof35
- }
- stCase35:
- switch (m.data)[(m.p)] {
- case 45:
- goto st36
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st36
+ goto tr74
+ case 77:
+ if (m.data)[(m.p)] == 99 {
+ goto tr94
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st36
+ goto tr74
+ case 78:
+ if (m.data)[(m.p)] == 104 {
+ goto tr95
}
- default:
- goto st36
- }
- goto tr6
- st36:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof36
- }
- stCase36:
- switch (m.data)[(m.p)] {
- case 45:
- goto st37
- case 58:
- goto tr10
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st37
+ goto tr74
+ case 79:
+ if (m.data)[(m.p)] == 101 {
+ goto tr96
}
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st37
+ goto tr74
+ case 80:
+ if (m.data)[(m.p)] == 109 {
+ goto tr97
}
- default:
- goto st37
- }
- goto tr6
- st37:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof37
- }
- stCase37:
- if (m.data)[(m.p)] == 58 {
- goto tr10
- }
- goto tr6
- tr10:
-
- output.ID = string(m.text())
-
- goto st38
- st38:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof38
- }
- stCase38:
- switch (m.data)[(m.p)] {
- case 33:
- goto tr42
- case 36:
- goto tr42
- case 37:
- goto tr43
- case 61:
- goto tr42
- case 95:
- goto tr42
- }
- switch {
- case (m.data)[(m.p)] < 48:
- if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
- goto tr42
+ goto tr74
+ case 81:
+ if (m.data)[(m.p)] == 97 {
+ goto tr98
+ }
+ goto tr74
+ case 82:
+ if (m.data)[(m.p)] == 115 {
+ goto tr79
+ }
+ goto tr74
+ case 83:
+ switch (m.data)[(m.p)] {
+ case 85:
+ goto tr99
+ case 117:
+ goto tr99
+ }
+ goto tr0
+ case 84:
+ switch (m.data)[(m.p)] {
+ case 82:
+ goto tr100
+ case 114:
+ goto tr100
+ }
+ goto tr0
+ case 85:
+ switch (m.data)[(m.p)] {
+ case 78:
+ goto tr101
+ case 110:
+ goto tr101
+ }
+ goto tr0
+ case 86:
+ if (m.data)[(m.p)] == 58 {
+ goto tr102
+ }
+ goto tr0
+ case 87:
+ switch (m.data)[(m.p)] {
+ case 85:
+ goto tr105
+ case 117:
+ goto tr105
}
- case (m.data)[(m.p)] > 59:
switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr104
+ }
case (m.data)[(m.p)] > 90:
if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto tr42
+ goto tr104
}
- case (m.data)[(m.p)] >= 64:
- goto tr42
+ default:
+ goto tr104
}
- default:
- goto tr42
- }
- goto tr41
- tr42:
-
- m.pb = m.p
-
- goto st44
- st44:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof44
- }
- stCase44:
- switch (m.data)[(m.p)] {
- case 33:
- goto st44
- case 36:
- goto st44
- case 37:
- goto st39
- case 61:
- goto st44
+ goto tr103
+ case 88:
+ if (m.data)[(m.p)] == 45 {
+ goto tr107
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr108
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr108
+ }
+ default:
+ goto tr108
+ }
+ goto tr106
+ case 89:
+ if (m.data)[(m.p)] == 45 {
+ goto tr109
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr110
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr110
+ }
+ default:
+ goto tr110
+ }
+ goto tr106
+ case 90:
+ if (m.data)[(m.p)] == 45 {
+ goto tr111
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr112
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr112
+ }
+ default:
+ goto tr112
+ }
+ goto tr106
+ case 91:
+ if (m.data)[(m.p)] == 45 {
+ goto tr113
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr114
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr114
+ }
+ default:
+ goto tr114
+ }
+ goto tr106
+ case 92:
+ if (m.data)[(m.p)] == 45 {
+ goto tr115
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr116
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr116
+ }
+ default:
+ goto tr116
+ }
+ goto tr106
+ case 93:
+ if (m.data)[(m.p)] == 45 {
+ goto tr117
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr118
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr118
+ }
+ default:
+ goto tr118
+ }
+ goto tr106
+ case 94:
+ if (m.data)[(m.p)] == 45 {
+ goto tr119
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr120
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr120
+ }
+ default:
+ goto tr120
+ }
+ goto tr106
case 95:
- goto st44
- }
- switch {
- case (m.data)[(m.p)] < 48:
- if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
- goto st44
+ if (m.data)[(m.p)] == 45 {
+ goto tr121
}
- case (m.data)[(m.p)] > 59:
switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr122
+ }
case (m.data)[(m.p)] > 90:
if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st44
+ goto tr122
}
- case (m.data)[(m.p)] >= 64:
- goto st44
+ default:
+ goto tr122
}
- default:
- goto st44
- }
- goto tr41
- tr43:
+ goto tr106
+ case 96:
+ if (m.data)[(m.p)] == 45 {
+ goto tr123
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr124
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr124
+ }
+ default:
+ goto tr124
+ }
+ goto tr106
+ case 97:
+ if (m.data)[(m.p)] == 45 {
+ goto tr125
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr126
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr126
+ }
+ default:
+ goto tr126
+ }
+ goto tr106
+ case 98:
+ if (m.data)[(m.p)] == 45 {
+ goto tr127
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr128
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr128
+ }
+ default:
+ goto tr128
+ }
+ goto tr106
+ case 99:
+ if (m.data)[(m.p)] == 45 {
+ goto tr129
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr130
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr130
+ }
+ default:
+ goto tr130
+ }
+ goto tr106
+ case 100:
+ if (m.data)[(m.p)] == 45 {
+ goto tr131
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr132
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr132
+ }
+ default:
+ goto tr132
+ }
+ goto tr106
+ case 101:
+ if (m.data)[(m.p)] == 45 {
+ goto tr133
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr134
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr134
+ }
+ default:
+ goto tr134
+ }
+ goto tr106
+ case 102:
+ if (m.data)[(m.p)] == 45 {
+ goto tr135
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr136
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr136
+ }
+ default:
+ goto tr136
+ }
+ goto tr106
+ case 103:
+ if (m.data)[(m.p)] == 45 {
+ goto tr137
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr138
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr138
+ }
+ default:
+ goto tr138
+ }
+ goto tr106
+ case 104:
+ if (m.data)[(m.p)] == 45 {
+ goto tr139
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr140
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr140
+ }
+ default:
+ goto tr140
+ }
+ goto tr106
+ case 105:
+ if (m.data)[(m.p)] == 45 {
+ goto tr141
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr142
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr142
+ }
+ default:
+ goto tr142
+ }
+ goto tr106
+ case 106:
+ if (m.data)[(m.p)] == 45 {
+ goto tr143
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr144
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr144
+ }
+ default:
+ goto tr144
+ }
+ goto tr106
+ case 107:
+ if (m.data)[(m.p)] == 45 {
+ goto tr145
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr146
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr146
+ }
+ default:
+ goto tr146
+ }
+ goto tr106
+ case 108:
+ if (m.data)[(m.p)] == 45 {
+ goto tr147
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr148
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr148
+ }
+ default:
+ goto tr148
+ }
+ goto tr106
+ case 109:
+ if (m.data)[(m.p)] == 45 {
+ goto tr149
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr150
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr150
+ }
+ default:
+ goto tr150
+ }
+ goto tr106
+ case 110:
+ if (m.data)[(m.p)] == 45 {
+ goto tr151
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr152
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr152
+ }
+ default:
+ goto tr152
+ }
+ goto tr106
+ case 111:
+ if (m.data)[(m.p)] == 45 {
+ goto tr153
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr154
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr154
+ }
+ default:
+ goto tr154
+ }
+ goto tr106
+ case 112:
+ if (m.data)[(m.p)] == 45 {
+ goto tr155
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr156
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr156
+ }
+ default:
+ goto tr156
+ }
+ goto tr106
+ case 113:
+ if (m.data)[(m.p)] == 45 {
+ goto tr157
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr158
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr158
+ }
+ default:
+ goto tr158
+ }
+ goto tr106
+ case 114:
+ if (m.data)[(m.p)] == 45 {
+ goto tr159
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr160
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr160
+ }
+ default:
+ goto tr160
+ }
+ goto tr106
+ case 115:
+ if (m.data)[(m.p)] == 45 {
+ goto tr161
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr162
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr162
+ }
+ default:
+ goto tr162
+ }
+ goto tr106
+ case 116:
+ if (m.data)[(m.p)] == 45 {
+ goto tr163
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr164
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr164
+ }
+ default:
+ goto tr164
+ }
+ goto tr106
+ case 117:
+ if (m.data)[(m.p)] == 45 {
+ goto tr165
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr166
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr166
+ }
+ default:
+ goto tr166
+ }
+ goto tr106
+ case 118:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr167
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr167
+ }
+ default:
+ goto tr167
+ }
+ goto tr106
+ case 119:
+ if (m.data)[(m.p)] == 58 {
+ goto tr168
+ }
+ goto tr106
+ case 120:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr170
+ case 37:
+ goto tr171
+ case 61:
+ goto tr170
+ case 95:
+ goto tr170
+ case 126:
+ goto tr170
+ }
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr170
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr170
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr170
+ }
+ default:
+ goto tr170
+ }
+ goto tr169
+ case 177:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr218
+ case 35:
+ goto tr219
+ case 37:
+ goto tr220
+ case 61:
+ goto tr218
+ case 63:
+ goto tr221
+ case 95:
+ goto tr218
+ case 126:
+ goto tr218
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr218
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr218
+ }
+ default:
+ goto tr218
+ }
+ goto tr169
+ case 178:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr222
+ case 37:
+ goto tr223
+ case 61:
+ goto tr222
+ case 95:
+ goto tr222
+ case 126:
+ goto tr222
+ }
+ switch {
+ case (m.data)[(m.p)] < 63:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr222
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr222
+ }
+ default:
+ goto tr222
+ }
+ goto tr183
+ case 179:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr224
+ case 37:
+ goto tr225
+ case 61:
+ goto tr224
+ case 95:
+ goto tr224
+ case 126:
+ goto tr224
+ }
+ switch {
+ case (m.data)[(m.p)] < 63:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr224
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr224
+ }
+ default:
+ goto tr224
+ }
+ goto tr183
+ case 121:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr173
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr173
+ }
+ default:
+ goto tr174
+ }
+ goto tr172
+ case 122:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr175
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr175
+ }
+ default:
+ goto tr176
+ }
+ goto tr172
+ case 180:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr224
+ case 37:
+ goto tr225
+ case 61:
+ goto tr224
+ case 95:
+ goto tr224
+ case 126:
+ goto tr224
+ }
+ switch {
+ case (m.data)[(m.p)] < 63:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr224
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr224
+ }
+ default:
+ goto tr224
+ }
+ goto tr172
+ case 123:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr178
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr178
+ }
+ default:
+ goto tr179
+ }
+ goto tr177
+ case 124:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr180
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr180
+ }
+ default:
+ goto tr181
+ }
+ goto tr177
+ case 181:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr218
+ case 35:
+ goto tr219
+ case 37:
+ goto tr220
+ case 61:
+ goto tr218
+ case 63:
+ goto tr221
+ case 95:
+ goto tr218
+ case 126:
+ goto tr218
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr218
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr218
+ }
+ default:
+ goto tr218
+ }
+ goto tr177
+ case 125:
+ switch (m.data)[(m.p)] {
+ case 43:
+ goto tr182
+ case 61:
+ goto tr184
+ }
+ goto tr183
+ case 126:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr186
+ case 37:
+ goto tr187
+ case 61:
+ goto tr186
+ case 63:
+ goto tr188
+ case 95:
+ goto tr186
+ case 126:
+ goto tr186
+ }
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr186
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr186
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr186
+ }
+ default:
+ goto tr186
+ }
+ goto tr185
+ case 182:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr226
+ case 35:
+ goto tr227
+ case 37:
+ goto tr228
+ case 61:
+ goto tr226
+ case 63:
+ goto tr229
+ case 95:
+ goto tr226
+ case 126:
+ goto tr226
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr226
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr226
+ }
+ default:
+ goto tr226
+ }
+ goto tr185
+ case 127:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr190
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr190
+ }
+ default:
+ goto tr191
+ }
+ goto tr189
+ case 128:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr192
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr192
+ }
+ default:
+ goto tr193
+ }
+ goto tr189
+ case 183:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr226
+ case 35:
+ goto tr227
+ case 37:
+ goto tr228
+ case 61:
+ goto tr226
+ case 63:
+ goto tr229
+ case 95:
+ goto tr226
+ case 126:
+ goto tr226
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr226
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr226
+ }
+ default:
+ goto tr226
+ }
+ goto tr189
+ case 184:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr226
+ case 35:
+ goto tr227
+ case 37:
+ goto tr228
+ case 43:
+ goto tr230
+ case 61:
+ goto tr231
+ case 63:
+ goto tr229
+ case 95:
+ goto tr226
+ case 126:
+ goto tr226
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr226
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr226
+ }
+ default:
+ goto tr226
+ }
+ goto tr185
+ case 185:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr232
+ case 35:
+ goto tr233
+ case 37:
+ goto tr234
+ case 47:
+ goto tr226
+ case 61:
+ goto tr232
+ case 63:
+ goto tr235
+ case 95:
+ goto tr232
+ case 126:
+ goto tr232
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr232
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr232
+ }
+ default:
+ goto tr232
+ }
+ goto tr185
+ case 186:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr204
+ case 35:
+ goto tr227
+ case 37:
+ goto tr237
+ case 47:
+ goto tr226
+ case 61:
+ goto tr204
+ case 63:
+ goto tr229
+ case 95:
+ goto tr204
+ case 126:
+ goto tr204
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr204
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr204
+ }
+ default:
+ goto tr204
+ }
+ goto tr236
+ case 187:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr238
+ case 35:
+ goto tr239
+ case 37:
+ goto tr240
+ case 61:
+ goto tr238
+ case 63:
+ goto tr241
+ case 95:
+ goto tr238
+ case 126:
+ goto tr238
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr238
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr238
+ }
+ default:
+ goto tr238
+ }
+ goto tr203
+ case 129:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr195
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr195
+ }
+ default:
+ goto tr196
+ }
+ goto tr194
+ case 130:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr197
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr197
+ }
+ default:
+ goto tr198
+ }
+ goto tr194
+ case 188:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr238
+ case 35:
+ goto tr239
+ case 37:
+ goto tr240
+ case 61:
+ goto tr238
+ case 63:
+ goto tr241
+ case 95:
+ goto tr238
+ case 126:
+ goto tr238
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr238
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr238
+ }
+ default:
+ goto tr238
+ }
+ goto tr194
+ case 189:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr238
+ case 35:
+ goto tr239
+ case 37:
+ goto tr240
+ case 61:
+ goto tr242
+ case 63:
+ goto tr241
+ case 95:
+ goto tr238
+ case 126:
+ goto tr238
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr238
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr238
+ }
+ default:
+ goto tr238
+ }
+ goto tr203
+ case 190:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr243
+ case 35:
+ goto tr244
+ case 37:
+ goto tr245
+ case 47:
+ goto tr238
+ case 61:
+ goto tr243
+ case 63:
+ goto tr246
+ case 95:
+ goto tr243
+ case 126:
+ goto tr243
+ }
+ switch {
+ case (m.data)[(m.p)] < 64:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 59 {
+ goto tr243
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr243
+ }
+ default:
+ goto tr243
+ }
+ goto tr203
+ case 131:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr200
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr200
+ }
+ default:
+ goto tr201
+ }
+ goto tr199
+ case 132:
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr197
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr197
+ }
+ default:
+ goto tr198
+ }
+ goto tr199
+ case 133:
+ if (m.data)[(m.p)] == 43 {
+ goto tr202
+ }
+ goto tr185
+ case 191:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr232
+ case 35:
+ goto tr233
+ case 37:
+ goto tr234
+ case 61:
+ goto tr232
+ case 63:
+ goto tr247
+ case 95:
+ goto tr232
+ case 126:
+ goto tr232
+ }
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr232
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr232
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr232
+ }
+ default:
+ goto tr232
+ }
+ goto tr185
+ case 134:
+ switch (m.data)[(m.p)] {
+ case 43:
+ goto tr202
+ case 61:
+ goto tr184
+ }
+ goto tr185
+ case 135:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr204
+ case 37:
+ goto tr205
+ case 61:
+ goto tr204
+ case 63:
+ goto tr206
+ case 95:
+ goto tr204
+ case 126:
+ goto tr204
+ }
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr204
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr204
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr204
+ }
+ default:
+ goto tr204
+ }
+ goto tr203
+ case 136:
+ if (m.data)[(m.p)] == 61 {
+ goto tr207
+ }
+ goto tr203
+ case 192:
+ switch (m.data)[(m.p)] {
+ case 33:
+ goto tr243
+ case 35:
+ goto tr244
+ case 37:
+ goto tr245
+ case 61:
+ goto tr243
+ case 63:
+ goto tr248
+ case 95:
+ goto tr243
+ case 126:
+ goto tr243
+ }
+ switch {
+ case (m.data)[(m.p)] < 48:
+ if 36 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
+ goto tr243
+ }
+ case (m.data)[(m.p)] > 59:
+ switch {
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr243
+ }
+ case (m.data)[(m.p)] >= 64:
+ goto tr243
+ }
+ default:
+ goto tr243
+ }
+ goto tr203
+ case 137:
+ if (m.data)[(m.p)] == 58 {
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr167
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr167
+ }
+ default:
+ goto tr167
+ }
+ goto tr106
+ case 138:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr165
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr166
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr166
+ }
+ default:
+ goto tr166
+ }
+ goto tr106
+ case 139:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr163
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr164
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr164
+ }
+ default:
+ goto tr164
+ }
+ goto tr106
+ case 140:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr161
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr162
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr162
+ }
+ default:
+ goto tr162
+ }
+ goto tr106
+ case 141:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr159
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr160
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr160
+ }
+ default:
+ goto tr160
+ }
+ goto tr106
+ case 142:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr157
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr158
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr158
+ }
+ default:
+ goto tr158
+ }
+ goto tr106
+ case 143:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr155
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr156
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr156
+ }
+ default:
+ goto tr156
+ }
+ goto tr106
+ case 144:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr153
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr154
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr154
+ }
+ default:
+ goto tr154
+ }
+ goto tr106
+ case 145:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr151
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr152
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr152
+ }
+ default:
+ goto tr152
+ }
+ goto tr106
+ case 146:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr149
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr150
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr150
+ }
+ default:
+ goto tr150
+ }
+ goto tr106
+ case 147:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr147
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr148
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr148
+ }
+ default:
+ goto tr148
+ }
+ goto tr106
+ case 148:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr145
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr146
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr146
+ }
+ default:
+ goto tr146
+ }
+ goto tr106
+ case 149:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr143
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr144
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr144
+ }
+ default:
+ goto tr144
+ }
+ goto tr106
+ case 150:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr141
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr142
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr142
+ }
+ default:
+ goto tr142
+ }
+ goto tr106
+ case 151:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr139
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr140
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr140
+ }
+ default:
+ goto tr140
+ }
+ goto tr106
+ case 152:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr137
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr138
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr138
+ }
+ default:
+ goto tr138
+ }
+ goto tr106
+ case 153:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr135
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr136
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr136
+ }
+ default:
+ goto tr136
+ }
+ goto tr106
+ case 154:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr133
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr134
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr134
+ }
+ default:
+ goto tr134
+ }
+ goto tr106
+ case 155:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr131
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr132
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr132
+ }
+ default:
+ goto tr132
+ }
+ goto tr106
+ case 156:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr129
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr130
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr130
+ }
+ default:
+ goto tr130
+ }
+ goto tr106
+ case 157:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr127
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr128
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr128
+ }
+ default:
+ goto tr128
+ }
+ goto tr106
+ case 158:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr125
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr126
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr126
+ }
+ default:
+ goto tr126
+ }
+ goto tr106
+ case 159:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr123
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr124
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr124
+ }
+ default:
+ goto tr124
+ }
+ goto tr106
+ case 160:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr121
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr122
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr122
+ }
+ default:
+ goto tr122
+ }
+ goto tr106
+ case 161:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr119
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr120
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr120
+ }
+ default:
+ goto tr120
+ }
+ goto tr106
+ case 162:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr117
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr118
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr118
+ }
+ default:
+ goto tr118
+ }
+ goto tr106
+ case 163:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr115
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr116
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr116
+ }
+ default:
+ goto tr116
+ }
+ goto tr106
+ case 164:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr113
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr114
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr114
+ }
+ default:
+ goto tr114
+ }
+ goto tr106
+ case 165:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr111
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr112
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr112
+ }
+ default:
+ goto tr112
+ }
+ goto tr106
+ case 166:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr109
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr110
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr110
+ }
+ default:
+ goto tr110
+ }
+ goto tr106
+ case 167:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr107
+ case 82:
+ goto tr208
+ case 114:
+ goto tr208
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr108
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr108
+ }
+ default:
+ goto tr108
+ }
+ goto tr103
+ case 168:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr109
+ case 58:
+ goto tr168
+ case 78:
+ goto tr209
+ case 110:
+ goto tr209
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr110
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr110
+ }
+ default:
+ goto tr110
+ }
+ goto tr103
+ case 169:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr210
+ case 58:
+ goto tr168
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr112
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr112
+ }
+ default:
+ goto tr112
+ }
+ goto tr106
+ case 170:
+ switch (m.data)[(m.p)] {
+ case 45:
+ goto tr113
+ case 48:
+ goto tr211
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 49 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr114
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr211
+ }
+ default:
+ goto tr211
+ }
+ goto tr106
+ case 171:
+ if (m.data)[(m.p)] == 45 {
+ goto tr115
+ }
+ switch {
+ case (m.data)[(m.p)] < 65:
+ if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
+ goto tr116
+ }
+ case (m.data)[(m.p)] > 90:
+ if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
+ goto tr116
+ }
+ default:
+ goto tr116
+ }
+ goto tr106
+ case 193:
+ switch (m.data)[(m.p)] {
+ case 10:
+ goto tr183
+ case 13:
+ goto tr183
+ }
+ goto tr249
+ }
+
+ tr183:
+ m.cs = 0
+ goto _again
+ tr0:
+ m.cs = 0
+ goto f0
+ tr5:
+ m.cs = 0
+ goto f3
+ tr8:
+ m.cs = 0
+ goto f5
+ tr41:
+ m.cs = 0
+ goto f7
+ tr44:
+ m.cs = 0
+ goto f8
+ tr51:
+ m.cs = 0
+ goto f10
+ tr56:
+ m.cs = 0
+ goto f11
+ tr74:
+ m.cs = 0
+ goto f13
+ tr81:
+ m.cs = 0
+ goto f15
+ tr83:
+ m.cs = 0
+ goto f17
+ tr86:
+ m.cs = 0
+ goto f19
+ tr103:
+ m.cs = 0
+ goto f20
+ tr106:
+ m.cs = 0
+ goto f21
+ tr169:
+ m.cs = 0
+ goto f22
+ tr172:
+ m.cs = 0
+ goto f23
+ tr177:
+ m.cs = 0
+ goto f24
+ tr185:
+ m.cs = 0
+ goto f25
+ tr189:
+ m.cs = 0
+ goto f27
+ tr194:
+ m.cs = 0
+ goto f28
+ tr199:
+ m.cs = 0
+ goto f29
+ tr203:
+ m.cs = 0
+ goto f30
+ tr236:
+ m.cs = 0
+ goto f46
+ tr1:
+ m.cs = 2
+ goto f1
+ tr2:
+ m.cs = 3
+ goto _again
+ tr3:
+ m.cs = 4
+ goto _again
+ tr4:
+ m.cs = 5
+ goto f2
+ tr6:
+ m.cs = 6
+ goto f4
+ tr9:
+ m.cs = 7
+ goto _again
+ tr11:
+ m.cs = 8
+ goto _again
+ tr12:
+ m.cs = 9
+ goto _again
+ tr13:
+ m.cs = 10
+ goto _again
+ tr14:
+ m.cs = 11
+ goto _again
+ tr15:
+ m.cs = 12
+ goto _again
+ tr16:
+ m.cs = 13
+ goto _again
+ tr17:
+ m.cs = 14
+ goto _again
+ tr18:
+ m.cs = 15
+ goto _again
+ tr19:
+ m.cs = 16
+ goto _again
+ tr20:
+ m.cs = 17
+ goto _again
+ tr21:
+ m.cs = 18
+ goto _again
+ tr22:
+ m.cs = 19
+ goto _again
+ tr23:
+ m.cs = 20
+ goto _again
+ tr24:
+ m.cs = 21
+ goto _again
+ tr25:
+ m.cs = 22
+ goto _again
+ tr26:
+ m.cs = 23
+ goto _again
+ tr27:
+ m.cs = 24
+ goto _again
+ tr28:
+ m.cs = 25
+ goto _again
+ tr29:
+ m.cs = 26
+ goto _again
+ tr30:
+ m.cs = 27
+ goto _again
+ tr31:
+ m.cs = 28
+ goto _again
+ tr32:
+ m.cs = 29
+ goto _again
+ tr33:
+ m.cs = 30
+ goto _again
+ tr34:
+ m.cs = 31
+ goto _again
+ tr35:
+ m.cs = 32
+ goto _again
+ tr36:
+ m.cs = 33
+ goto _again
+ tr37:
+ m.cs = 34
+ goto _again
+ tr38:
+ m.cs = 35
+ goto _again
+ tr39:
+ m.cs = 36
+ goto _again
+ tr40:
+ m.cs = 37
+ goto _again
+ tr10:
+ m.cs = 38
+ goto f6
+ tr213:
+ m.cs = 39
+ goto _again
+ tr43:
+ m.cs = 39
+ goto f4
+ tr45:
+ m.cs = 40
+ goto _again
+ tr46:
+ m.cs = 40
+ goto f9
+ tr7:
+ m.cs = 41
+ goto f1
+ tr49:
+ m.cs = 42
+ goto _again
+ tr50:
+ m.cs = 43
+ goto _again
+ tr52:
+ m.cs = 45
+ goto f1
+ tr53:
+ m.cs = 46
+ goto _again
+ tr54:
+ m.cs = 47
+ goto _again
+ tr55:
+ m.cs = 48
+ goto f2
+ tr57:
+ m.cs = 49
+ goto f4
+ tr58:
+ m.cs = 50
+ goto _again
+ tr59:
+ m.cs = 51
+ goto _again
+ tr60:
+ m.cs = 52
+ goto _again
+ tr61:
+ m.cs = 53
+ goto _again
+ tr62:
+ m.cs = 54
+ goto _again
+ tr63:
+ m.cs = 55
+ goto _again
+ tr64:
+ m.cs = 56
+ goto _again
+ tr65:
+ m.cs = 57
+ goto _again
+ tr66:
+ m.cs = 58
+ goto _again
+ tr67:
+ m.cs = 59
+ goto _again
+ tr68:
+ m.cs = 60
+ goto _again
+ tr69:
+ m.cs = 61
+ goto _again
+ tr70:
+ m.cs = 62
+ goto _again
+ tr71:
+ m.cs = 63
+ goto _again
+ tr72:
+ m.cs = 64
+ goto _again
+ tr73:
+ m.cs = 65
+ goto f12
+ tr75:
+ m.cs = 66
+ goto f4
+ tr78:
+ m.cs = 67
+ goto _again
+ tr79:
+ m.cs = 68
+ goto _again
+ tr80:
+ m.cs = 69
+ goto f14
+ tr215:
+ m.cs = 70
+ goto f35
+ tr217:
+ m.cs = 71
+ goto _again
+ tr85:
+ m.cs = 71
+ goto f18
+ tr87:
+ m.cs = 72
+ goto _again
+ tr88:
+ m.cs = 72
+ goto f9
+ tr76:
+ m.cs = 73
+ goto f4
+ tr91:
+ m.cs = 74
+ goto _again
+ tr92:
+ m.cs = 75
+ goto _again
+ tr93:
+ m.cs = 76
+ goto _again
+ tr77:
+ m.cs = 77
+ goto f4
+ tr94:
+ m.cs = 78
+ goto _again
+ tr95:
+ m.cs = 79
+ goto _again
+ tr96:
+ m.cs = 80
+ goto _again
+ tr97:
+ m.cs = 81
+ goto _again
+ tr98:
+ m.cs = 82
+ goto _again
+ tr99:
+ m.cs = 84
+ goto f1
+ tr100:
+ m.cs = 85
+ goto _again
+ tr101:
+ m.cs = 86
+ goto _again
+ tr102:
+ m.cs = 87
+ goto f2
+ tr104:
+ m.cs = 88
+ goto f4
+ tr107:
+ m.cs = 89
+ goto _again
+ tr109:
+ m.cs = 90
+ goto _again
+ tr111:
+ m.cs = 91
+ goto _again
+ tr113:
+ m.cs = 92
+ goto _again
+ tr115:
+ m.cs = 93
+ goto _again
+ tr117:
+ m.cs = 94
+ goto _again
+ tr119:
+ m.cs = 95
+ goto _again
+ tr121:
+ m.cs = 96
+ goto _again
+ tr123:
+ m.cs = 97
+ goto _again
+ tr125:
+ m.cs = 98
+ goto _again
+ tr127:
+ m.cs = 99
+ goto _again
+ tr129:
+ m.cs = 100
+ goto _again
+ tr131:
+ m.cs = 101
+ goto _again
+ tr133:
+ m.cs = 102
+ goto _again
+ tr135:
+ m.cs = 103
+ goto _again
+ tr137:
+ m.cs = 104
+ goto _again
+ tr139:
+ m.cs = 105
+ goto _again
+ tr141:
+ m.cs = 106
+ goto _again
+ tr143:
+ m.cs = 107
+ goto _again
+ tr145:
+ m.cs = 108
+ goto _again
+ tr147:
+ m.cs = 109
+ goto _again
+ tr149:
+ m.cs = 110
+ goto _again
+ tr151:
+ m.cs = 111
+ goto _again
+ tr153:
+ m.cs = 112
+ goto _again
+ tr155:
+ m.cs = 113
+ goto _again
+ tr157:
+ m.cs = 114
+ goto _again
+ tr159:
+ m.cs = 115
+ goto _again
+ tr161:
+ m.cs = 116
+ goto _again
+ tr163:
+ m.cs = 117
+ goto _again
+ tr165:
+ m.cs = 118
+ goto _again
+ tr167:
+ m.cs = 119
+ goto _again
+ tr168:
+ m.cs = 120
+ goto f6
+ tr225:
+ m.cs = 121
+ goto _again
+ tr223:
+ m.cs = 121
+ goto f4
+ tr173:
+ m.cs = 122
+ goto _again
+ tr174:
+ m.cs = 122
+ goto f9
+ tr220:
+ m.cs = 123
+ goto _again
+ tr171:
+ m.cs = 123
+ goto f4
+ tr178:
+ m.cs = 124
+ goto _again
+ tr179:
+ m.cs = 124
+ goto f9
+ tr221:
+ m.cs = 125
+ goto f38
+ tr182:
+ m.cs = 126
+ goto _again
+ tr228:
+ m.cs = 127
+ goto _again
+ tr187:
+ m.cs = 127
+ goto f26
+ tr234:
+ m.cs = 127
+ goto f44
+ tr190:
+ m.cs = 128
+ goto _again
+ tr191:
+ m.cs = 128
+ goto f9
+ tr240:
+ m.cs = 129
+ goto _again
+ tr205:
+ m.cs = 129
+ goto f31
+ tr245:
+ m.cs = 129
+ goto f50
+ tr195:
+ m.cs = 130
+ goto _again
+ tr196:
+ m.cs = 130
+ goto f9
+ tr237:
+ m.cs = 131
+ goto f31
+ tr200:
+ m.cs = 132
+ goto _again
+ tr201:
+ m.cs = 132
+ goto f9
+ tr188:
+ m.cs = 133
+ goto f26
+ tr247:
+ m.cs = 134
+ goto f45
+ tr184:
+ m.cs = 135
+ goto _again
+ tr206:
+ m.cs = 136
+ goto f31
+ tr248:
+ m.cs = 136
+ goto f50
+ tr166:
+ m.cs = 137
+ goto _again
+ tr164:
+ m.cs = 138
+ goto _again
+ tr162:
+ m.cs = 139
+ goto _again
+ tr160:
+ m.cs = 140
+ goto _again
+ tr158:
+ m.cs = 141
+ goto _again
+ tr156:
+ m.cs = 142
+ goto _again
+ tr154:
+ m.cs = 143
+ goto _again
+ tr152:
+ m.cs = 144
+ goto _again
+ tr150:
+ m.cs = 145
+ goto _again
+ tr148:
+ m.cs = 146
+ goto _again
+ tr146:
+ m.cs = 147
+ goto _again
+ tr144:
+ m.cs = 148
+ goto _again
+ tr142:
+ m.cs = 149
+ goto _again
+ tr140:
+ m.cs = 150
+ goto _again
+ tr138:
+ m.cs = 151
+ goto _again
+ tr136:
+ m.cs = 152
+ goto _again
+ tr134:
+ m.cs = 153
+ goto _again
+ tr132:
+ m.cs = 154
+ goto _again
+ tr130:
+ m.cs = 155
+ goto _again
+ tr128:
+ m.cs = 156
+ goto _again
+ tr126:
+ m.cs = 157
+ goto _again
+ tr124:
+ m.cs = 158
+ goto _again
+ tr122:
+ m.cs = 159
+ goto _again
+ tr120:
+ m.cs = 160
+ goto _again
+ tr118:
+ m.cs = 161
+ goto _again
+ tr116:
+ m.cs = 162
+ goto _again
+ tr114:
+ m.cs = 163
+ goto _again
+ tr112:
+ m.cs = 164
+ goto _again
+ tr110:
+ m.cs = 165
+ goto _again
+ tr108:
+ m.cs = 166
+ goto _again
+ tr105:
+ m.cs = 167
+ goto f1
+ tr208:
+ m.cs = 168
+ goto _again
+ tr209:
+ m.cs = 169
+ goto _again
+ tr210:
+ m.cs = 170
+ goto f2
+ tr211:
+ m.cs = 171
+ goto _again
+ tr212:
+ m.cs = 172
+ goto _again
+ tr42:
+ m.cs = 172
+ goto f4
+ tr47:
+ m.cs = 173
+ goto _again
+ tr48:
+ m.cs = 173
+ goto f9
+ tr214:
+ m.cs = 174
+ goto _again
+ tr82:
+ m.cs = 174
+ goto f16
+ tr216:
+ m.cs = 175
+ goto _again
+ tr84:
+ m.cs = 175
+ goto f18
+ tr89:
+ m.cs = 176
+ goto _again
+ tr90:
+ m.cs = 176
+ goto f9
+ tr218:
+ m.cs = 177
+ goto _again
+ tr170:
+ m.cs = 177
+ goto f4
+ tr219:
+ m.cs = 178
+ goto f38
+ tr227:
+ m.cs = 178
+ goto f42
+ tr233:
+ m.cs = 178
+ goto f45
+ tr239:
+ m.cs = 178
+ goto f48
+ tr244:
+ m.cs = 178
+ goto f51
+ tr224:
+ m.cs = 179
+ goto _again
+ tr222:
+ m.cs = 179
+ goto f4
+ tr175:
+ m.cs = 180
+ goto _again
+ tr176:
+ m.cs = 180
+ goto f9
+ tr180:
+ m.cs = 181
+ goto _again
+ tr181:
+ m.cs = 181
+ goto f9
+ tr226:
+ m.cs = 182
+ goto _again
+ tr186:
+ m.cs = 182
+ goto f26
+ tr232:
+ m.cs = 182
+ goto f44
+ tr192:
+ m.cs = 183
+ goto _again
+ tr193:
+ m.cs = 183
+ goto f9
+ tr229:
+ m.cs = 184
+ goto f42
+ tr235:
+ m.cs = 184
+ goto f45
+ tr230:
+ m.cs = 185
+ goto _again
+ tr231:
+ m.cs = 186
+ goto _again
+ tr238:
+ m.cs = 187
+ goto _again
+ tr204:
+ m.cs = 187
+ goto f31
+ tr243:
+ m.cs = 187
+ goto f50
+ tr197:
+ m.cs = 188
+ goto _again
+ tr198:
+ m.cs = 188
+ goto f9
+ tr241:
+ m.cs = 189
+ goto _again
+ tr246:
+ m.cs = 189
+ goto f50
+ tr242:
+ m.cs = 190
+ goto _again
+ tr202:
+ m.cs = 191
+ goto _again
+ tr207:
+ m.cs = 192
+ goto _again
+ tr249:
+ m.cs = 193
+ goto _again
+
+ f4:
+
+ m.pb = m.p
+
+ goto _again
+ f9:
+
+ // List of positions in the buffer to later lowercase
+ output.tolower = append(output.tolower, m.p-m.pb)
+
+ goto _again
+ f2:
+
+ output.prefix = string(m.text())
+
+ goto _again
+ f6:
+
+ output.ID = string(m.text())
+
+ goto _again
+ f38:
+
+ output.SS = string(m.text())
+ // Iterate upper letters lowering them
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] + 32
+ }
+ output.norm = string(m.text())
+ // Revert the buffer to the original
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] - 32
+ }
+
+ goto _again
+ f0:
+
+ m.err = fmt.Errorf(errPrefix, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f5:
+
+ m.err = fmt.Errorf(errIdentifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f7:
+
+ m.err = fmt.Errorf(errSpecificString, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f23:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+
+ goto _again
+ f11:
+
+ m.err = fmt.Errorf(errSCIMNamespace, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f13:
+
+ m.err = fmt.Errorf(errSCIMType, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f15:
+
+ m.err = fmt.Errorf(errSCIMName, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f17:
+
+ if m.p == m.pe {
+ m.err = fmt.Errorf(errSCIMOtherIncomplete, m.p-1)
+ } else {
+ m.err = fmt.Errorf(errSCIMOther, m.p)
+ }
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f14:
+
+ output.scim.Type = scimschema.TypeFromString(string(m.text()))
+
+ goto _again
+ f16:
+
+ output.scim.pos = m.p
+
+ goto _again
+ f35:
+
+ output.scim.Name = string(m.data[output.scim.pos:m.p])
+
+ goto _again
+ f18:
+
+ output.scim.pos = m.p
+
+ goto _again
+ f22:
+
+ m.err = fmt.Errorf(err8141SpecificString, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f21:
+
+ m.err = fmt.Errorf(err8141Identifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f42:
+
+ output.rComponent = string(m.text())
+
+ goto _again
+ f48:
+
+ output.qComponent = string(m.text())
+
+ goto _again
+ f44:
+
+ if output.rStart {
+ m.err = fmt.Errorf(err8141RComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+ output.rStart = true
+
+ goto _again
+ f50:
+
+ if output.qStart {
+ m.err = fmt.Errorf(err8141QComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+ output.qStart = true
+
+ goto _again
+ f25:
+
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f30:
+
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f1:
+
+ m.pb = m.p
+
+ if m.parsingMode != RFC8141Only {
+ // Throw an error when:
+ // - we are entering here matching the the prefix in the namespace identifier part
+ // - looking ahead (3 chars) we find a colon
+ if pos := m.p + 3; pos < m.pe && m.data[pos] == 58 && output.prefix != "" {
+ m.err = fmt.Errorf(errNoUrnWithinID, pos)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+ }
+
+ goto _again
+ f12:
+
+ output.ID = string(m.text())
+
+ output.scim = &SCIM{}
+
+ goto _again
+ f3:
+
+ m.err = fmt.Errorf(errIdentifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(errPrefix, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f10:
+
+ m.err = fmt.Errorf(errIdentifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(errNoUrnWithinID, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f8:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+
+ m.err = fmt.Errorf(errSpecificString, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f19:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+
+ if m.p == m.pe {
+ m.err = fmt.Errorf(errSCIMOtherIncomplete, m.p-1)
+ } else {
+ m.err = fmt.Errorf(errSCIMOther, m.p)
+ }
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f24:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+
+ m.err = fmt.Errorf(err8141SpecificString, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f27:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f28:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f20:
+
+ m.err = fmt.Errorf(err8141Identifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(errPrefix, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f26:
+
+ if output.rStart {
+ m.err = fmt.Errorf(err8141RComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+ output.rStart = true
m.pb = m.p
- goto st39
- st39:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof39
- }
- stCase39:
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st40
- }
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st40
- }
- default:
- goto tr46
- }
- goto tr44
- tr46:
+ goto _again
+ f45:
- m.tolower = append(m.tolower, m.p-m.pb)
+ if output.rStart {
+ m.err = fmt.Errorf(err8141RComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
- goto st40
- st40:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof40
- }
- stCase40:
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st45
- }
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st45
- }
- default:
- goto tr48
}
- goto tr44
- tr48:
+ output.rStart = true
- m.tolower = append(m.tolower, m.p-m.pb)
+ output.rComponent = string(m.text())
+
+ goto _again
+ f31:
+
+ if output.qStart {
+ m.err = fmt.Errorf(err8141QComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
- goto st45
- st45:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof45
- }
- stCase45:
- switch (m.data)[(m.p)] {
- case 33:
- goto st44
- case 36:
- goto st44
- case 37:
- goto st39
- case 61:
- goto st44
- case 95:
- goto st44
- }
- switch {
- case (m.data)[(m.p)] < 48:
- if 39 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 46 {
- goto st44
- }
- case (m.data)[(m.p)] > 59:
- switch {
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st44
- }
- case (m.data)[(m.p)] >= 64:
- goto st44
- }
- default:
- goto st44
}
- goto tr44
- tr8:
+ output.qStart = true
m.pb = m.p
- goto st41
- st41:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof41
- }
- stCase41:
- switch (m.data)[(m.p)] {
- case 45:
- goto st7
- case 58:
- goto tr10
- case 82:
- goto st42
- case 114:
- goto st42
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st7
- }
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st7
- }
- default:
- goto st7
- }
- goto tr6
- st42:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof42
- }
- stCase42:
- switch (m.data)[(m.p)] {
- case 45:
- goto st8
- case 58:
- goto tr10
- case 78:
- goto st43
- case 110:
- goto st43
- }
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st8
- }
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st8
- }
- default:
- goto st8
- }
- goto tr50
- st43:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof43
+ goto _again
+ f51:
+
+ if output.qStart {
+ m.err = fmt.Errorf(err8141QComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- stCase43:
- if (m.data)[(m.p)] == 45 {
- goto st9
+ output.qStart = true
+
+ output.qComponent = string(m.text())
+
+ goto _again
+ f46:
+
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+ f29:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- switch {
- case (m.data)[(m.p)] < 65:
- if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
- goto st9
- }
- case (m.data)[(m.p)] > 90:
- if 97 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 122 {
- goto st9
- }
- default:
- goto st9
+
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ goto _again
+
+ _again:
+ switch _toStateActions[m.cs] {
+ case 33:
+
+ (m.p)--
+
+ m.err = fmt.Errorf(err8141InformalID, m.p)
+ m.cs = 193
+ goto _again
}
- goto tr52
- st46:
- if (m.p)++; (m.p) == (m.pe) {
- goto _testEof46
+
+ if m.cs == 0 {
+ goto _out
}
- stCase46:
- switch (m.data)[(m.p)] {
- case 10:
- goto st0
- case 13:
- goto st0
+ if (m.p)++; (m.p) != (m.pe) {
+ goto _resume
}
- goto st46
- stOut:
- _testEof2:
- m.cs = 2
- goto _testEof
- _testEof3:
- m.cs = 3
- goto _testEof
- _testEof4:
- m.cs = 4
- goto _testEof
- _testEof5:
- m.cs = 5
- goto _testEof
- _testEof6:
- m.cs = 6
- goto _testEof
- _testEof7:
- m.cs = 7
- goto _testEof
- _testEof8:
- m.cs = 8
- goto _testEof
- _testEof9:
- m.cs = 9
- goto _testEof
- _testEof10:
- m.cs = 10
- goto _testEof
- _testEof11:
- m.cs = 11
- goto _testEof
- _testEof12:
- m.cs = 12
- goto _testEof
- _testEof13:
- m.cs = 13
- goto _testEof
- _testEof14:
- m.cs = 14
- goto _testEof
- _testEof15:
- m.cs = 15
- goto _testEof
- _testEof16:
- m.cs = 16
- goto _testEof
- _testEof17:
- m.cs = 17
- goto _testEof
- _testEof18:
- m.cs = 18
- goto _testEof
- _testEof19:
- m.cs = 19
- goto _testEof
- _testEof20:
- m.cs = 20
- goto _testEof
- _testEof21:
- m.cs = 21
- goto _testEof
- _testEof22:
- m.cs = 22
- goto _testEof
- _testEof23:
- m.cs = 23
- goto _testEof
- _testEof24:
- m.cs = 24
- goto _testEof
- _testEof25:
- m.cs = 25
- goto _testEof
- _testEof26:
- m.cs = 26
- goto _testEof
- _testEof27:
- m.cs = 27
- goto _testEof
- _testEof28:
- m.cs = 28
- goto _testEof
- _testEof29:
- m.cs = 29
- goto _testEof
- _testEof30:
- m.cs = 30
- goto _testEof
- _testEof31:
- m.cs = 31
- goto _testEof
- _testEof32:
- m.cs = 32
- goto _testEof
- _testEof33:
- m.cs = 33
- goto _testEof
- _testEof34:
- m.cs = 34
- goto _testEof
- _testEof35:
- m.cs = 35
- goto _testEof
- _testEof36:
- m.cs = 36
- goto _testEof
- _testEof37:
- m.cs = 37
- goto _testEof
- _testEof38:
- m.cs = 38
- goto _testEof
- _testEof44:
- m.cs = 44
- goto _testEof
- _testEof39:
- m.cs = 39
- goto _testEof
- _testEof40:
- m.cs = 40
- goto _testEof
- _testEof45:
- m.cs = 45
- goto _testEof
- _testEof41:
- m.cs = 41
- goto _testEof
- _testEof42:
- m.cs = 42
- goto _testEof
- _testEof43:
- m.cs = 43
- goto _testEof
- _testEof46:
- m.cs = 46
- goto _testEof
-
_testEof:
{
}
if (m.p) == (m.eof) {
- switch m.cs {
- case 44, 45:
+ switch _eofActions[m.cs] {
+ case 1:
- raw := m.text()
- output.SS = string(raw)
- // Iterate upper letters lowering them
- for _, i := range m.tolower {
- raw[i] = raw[i] + 32
- }
- output.norm = string(raw)
+ m.err = fmt.Errorf(errPrefix, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
- case 1, 2, 4:
+ case 6:
- m.err = fmt.Errorf(errParse, m.p)
+ m.err = fmt.Errorf(errIdentifier, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- case 3:
+ case 8:
- m.err = fmt.Errorf(errPrefix, m.p)
+ m.err = fmt.Errorf(errSpecificString, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 24:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- m.err = fmt.Errorf(errParse, m.p)
+ case 12:
+
+ m.err = fmt.Errorf(errSCIMNamespace, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- case 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 41:
+ case 14:
- m.err = fmt.Errorf(errIdentifier, m.p)
+ m.err = fmt.Errorf(errSCIMType, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- m.err = fmt.Errorf(errParse, m.p)
+ case 16:
+
+ m.err = fmt.Errorf(errSCIMName, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 18:
+
+ if m.p == m.pe {
+ m.err = fmt.Errorf(errSCIMOtherIncomplete, m.p-1)
+ } else {
+ m.err = fmt.Errorf(errSCIMOther, m.p)
}
+ (m.p)--
- case 38:
+ m.cs = 193
+ goto _again
- m.err = fmt.Errorf(errSpecificString, m.p)
+ case 23:
+
+ m.err = fmt.Errorf(err8141SpecificString, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- m.err = fmt.Errorf(errParse, m.p)
+ case 22:
+
+ m.err = fmt.Errorf(err8141Identifier, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- case 42:
+ case 26:
- m.err = fmt.Errorf(errPrefix, m.p)
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ case 31:
+
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 34:
+
+ output.SS = string(m.text())
+ // Iterate upper letters lowering them
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] + 32
+ }
+ output.norm = string(m.text())
+ // Revert the buffer to the original
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] - 32
+ }
+
+ output.kind = RFC2141
+
+ case 38:
+
+ output.SS = string(m.text())
+ // Iterate upper letters lowering them
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] + 32
}
+ output.norm = string(m.text())
+ // Revert the buffer to the original
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] - 32
+ }
+
+ output.kind = RFC8141
+
+ case 4:
m.err = fmt.Errorf(errIdentifier, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- m.err = fmt.Errorf(errParse, m.p)
+ m.err = fmt.Errorf(errPrefix, m.p)
(m.p)--
- {
- goto st46
- }
+ m.cs = 193
+ goto _again
- case 43:
+ case 11:
+
+ m.err = fmt.Errorf(errIdentifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
m.err = fmt.Errorf(errNoUrnWithinID, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 9:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- m.err = fmt.Errorf(errIdentifier, m.p)
+ m.err = fmt.Errorf(errSpecificString, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 20:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- m.err = fmt.Errorf(errParse, m.p)
+ if m.p == m.pe {
+ m.err = fmt.Errorf(errSCIMOtherIncomplete, m.p-1)
+ } else {
+ m.err = fmt.Errorf(errSCIMOther, m.p)
+ }
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 25:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- case 39, 40:
+ m.err = fmt.Errorf(err8141SpecificString, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ case 28:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
- m.err = fmt.Errorf(errHex, m.p)
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 29:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- m.err = fmt.Errorf(errSpecificString, m.p)
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ case 21:
+
+ m.err = fmt.Errorf(err8141Identifier, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(errPrefix, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ case 42:
+
+ output.rComponent = string(m.text())
+
+ output.kind = RFC8141
+
+ case 48:
+
+ output.qComponent = string(m.text())
+
+ output.kind = RFC8141
+
+ case 41:
+
+ output.fComponent = string(m.text())
+
+ output.kind = RFC8141
+
+ case 40:
+
+ m.pb = m.p
+
+ output.fComponent = string(m.text())
+
+ output.kind = RFC8141
+
+ case 30:
+
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
- m.err = fmt.Errorf(errParse, m.p)
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
(m.p)--
- {
- goto st46
+ m.cs = 193
+ goto _again
+
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ case 35:
+
+ output.scim.Name = string(m.data[output.scim.pos:m.p])
+
+ output.SS = string(m.text())
+ // Iterate upper letters lowering them
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] + 32
+ }
+ output.norm = string(m.text())
+ // Revert the buffer to the original
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] - 32
+ }
+
+ output.kind = RFC7643
+
+ case 37:
+
+ output.scim.Other = string(m.data[output.scim.pos:m.p])
+
+ output.SS = string(m.text())
+ // Iterate upper letters lowering them
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] + 32
+ }
+ output.norm = string(m.text())
+ // Revert the buffer to the original
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] - 32
+ }
+
+ output.kind = RFC7643
+
+ case 44:
+
+ if output.rStart {
+ m.err = fmt.Errorf(err8141RComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
+ }
+ output.rStart = true
+
+ output.rComponent = string(m.text())
+
+ output.kind = RFC8141
+
+ case 50:
+
+ if output.qStart {
+ m.err = fmt.Errorf(err8141QComponentStart, m.p)
+ (m.p)--
+
+ m.cs = 193
+ goto _again
+
}
+ output.qStart = true
+ output.qComponent = string(m.text())
+
+ output.kind = RFC8141
}
}
@@ -1689,3 +5031,16 @@ func (m *machine) Parse(input []byte) (*URN, error) {
return output, nil
}
+
+func (m *machine) WithParsingMode(x ParsingMode) {
+ m.parsingMode = x
+ switch m.parsingMode {
+ case RFC2141Only:
+ m.startParsingAt = enMain
+ case RFC8141Only:
+ m.startParsingAt = enRfc8141Only
+ case RFC7643Only:
+ m.startParsingAt = enScimOnly
+ }
+ m.parsingModeSet = true
+}
diff --git a/vendor/github.com/leodido/go-urn/machine.go.rl b/vendor/github.com/leodido/go-urn/machine.go.rl
index 3bc05a651a..0a17421998 100644
--- a/vendor/github.com/leodido/go-urn/machine.go.rl
+++ b/vendor/github.com/leodido/go-urn/machine.go.rl
@@ -2,15 +2,28 @@ package urn
import (
"fmt"
+
+ scimschema "github.com/leodido/go-urn/scim/schema"
)
var (
- errPrefix = "expecting the prefix to be the \"urn\" string (whatever case) [col %d]"
- errIdentifier = "expecting the identifier to be string (1..31 alnum chars, also containing dashes but not at its start) [col %d]"
- errSpecificString = "expecting the specific string to be a string containing alnum, hex, or others ([()+,-.:=@;$_!*']) chars [col %d]"
- errNoUrnWithinID = "expecting the identifier to not contain the \"urn\" reserved string [col %d]"
- errHex = "expecting the specific string hex chars to be well-formed (%%alnum{2}) [col %d]"
- errParse = "parsing error [col %d]"
+ errPrefix = "expecting the prefix to be the \"urn\" string (whatever case) [col %d]"
+ errIdentifier = "expecting the identifier to be string (1..31 alnum chars, also containing dashes but not at its beginning) [col %d]"
+ errSpecificString = "expecting the specific string to be a string containing alnum, hex, or others ([()+,-.:=@;$_!*']) chars [col %d]"
+ errNoUrnWithinID = "expecting the identifier to not contain the \"urn\" reserved string [col %d]"
+ errHex = "expecting the percent encoded chars to be well-formed (%%alnum{2}) [col %d]"
+ errSCIMNamespace = "expecing the SCIM namespace identifier (ietf:params:scim) [col %d]"
+ errSCIMType = "expecting a correct SCIM type (schemas, api, param) [col %d]"
+ errSCIMName = "expecting one or more alnum char in the SCIM name part [col %d]"
+ errSCIMOther = "expecting a well-formed other SCIM part [col %d]"
+ errSCIMOtherIncomplete = "expecting a not empty SCIM other part after colon [col %d]"
+ err8141InformalID = "informal URN namespace must be in the form urn-[1-9][0-9] [col %d]"
+ err8141SpecificString = "expecting the specific string to contain alnum, hex, or others ([~&()+,-.:=@;$_!*'] or [/?] not in first position) chars [col %d]"
+ err8141Identifier = "expecting the indentifier to be a string with (length 2 to 32 chars) containing alnum (or dashes) not starting or ending with a dash [col %d]"
+ err8141RComponentStart = "expecting only one r-component (starting with the ?+ sequence) [col %d]"
+ err8141QComponentStart = "expecting only one q-component (starting with the ?= sequence) [col %d]"
+ err8141MalformedRComp = "expecting a non-empty r-component containing alnum, hex, or others ([~&()+,-.:=@;$_!*'] or [/?] but not at its beginning) [col %d]"
+ err8141MalformedQComp = "expecting a non-empty q-component containing alnum, hex, or others ([~&()+,-.:=@;$_!*'] or [/?] but not at its beginning) [col %d]"
)
%%{
@@ -24,25 +37,42 @@ action mark {
}
action tolower {
- m.tolower = append(m.tolower, m.p - m.pb)
+ // List of positions in the buffer to later lowercase
+ output.tolower = append(output.tolower, m.p - m.pb)
}
action set_pre {
output.prefix = string(m.text())
}
+action throw_pre_urn_err {
+ if m.parsingMode != RFC8141Only {
+ // Throw an error when:
+ // - we are entering here matching the the prefix in the namespace identifier part
+ // - looking ahead (3 chars) we find a colon
+ if pos := m.p + 3; pos < m.pe && m.data[pos] == 58 && output.prefix != "" {
+ m.err = fmt.Errorf(errNoUrnWithinID, pos)
+ fhold;
+ fgoto fail;
+ }
+ }
+}
+
action set_nid {
output.ID = string(m.text())
}
action set_nss {
- raw := m.text()
- output.SS = string(raw)
+ output.SS = string(m.text())
// Iterate upper letters lowering them
- for _, i := range m.tolower {
- raw[i] = raw[i] + 32
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] + 32
+ }
+ output.norm = string(m.text())
+ // Revert the buffer to the original
+ for _, i := range output.tolower {
+ m.data[m.pb+i] = m.data[m.pb+i] - 32
}
- output.norm = string(raw)
}
action err_pre {
@@ -70,30 +100,200 @@ action err_urn {
}
action err_hex {
- m.err = fmt.Errorf(errHex, m.p)
+ if m.parsingMode == RFC2141Only || m.parsingMode == RFC8141Only {
+ m.err = fmt.Errorf(errHex, m.p)
+ fhold;
+ fgoto fail;
+ }
+}
+
+action base_type {
+ output.kind = RFC2141;
+}
+
+pre = ([uU] @err(err_pre) [rR] @err(err_pre) [nN] @err(err_pre)) >mark >throw_pre_urn_err %set_pre;
+
+nid = (alnum >mark (alnum | '-'){0,31}) $err(err_nid) %set_nid;
+
+hex = '%' (digit | lower | upper >tolower){2} $err(err_hex);
+
+sss = (alnum | [()+,\-.:=@;$_!*']);
+
+nss = (sss | hex)+ $err(err_nss);
+
+nid_not_urn = (nid - pre %err(err_urn));
+
+urn = pre ':' @err(err_pre) (nid_not_urn ':' nss >mark %set_nss) %eof(base_type);
+
+### SCIM BEG
+
+action err_scim_nid {
+ m.err = fmt.Errorf(errSCIMNamespace, m.p)
fhold;
fgoto fail;
}
-action err_parse {
- m.err = fmt.Errorf(errParse, m.p)
+action err_scim_type {
+ m.err = fmt.Errorf(errSCIMType, m.p)
fhold;
fgoto fail;
}
-pre = ([uU][rR][nN] @err(err_pre)) >mark %set_pre;
+action err_scim_name {
+ m.err = fmt.Errorf(errSCIMName, m.p)
+ fhold;
+ fgoto fail;
+}
-nid = (alnum >mark (alnum | '-'){0,31}) %set_nid;
+action err_scim_other {
+ if m.p == m.pe {
+ m.err = fmt.Errorf(errSCIMOtherIncomplete, m.p-1)
+ } else {
+ m.err = fmt.Errorf(errSCIMOther, m.p)
+ }
+ fhold;
+ fgoto fail;
+}
-hex = '%' (digit | lower | upper >tolower){2} $err(err_hex);
+action scim_type {
+ output.kind = RFC7643;
+}
-sss = (alnum | [()+,\-.:=@;$_!*']);
+action create_scim {
+ output.scim = &SCIM{};
+}
-nss = (sss | hex)+ $err(err_nss);
+action set_scim_type {
+ output.scim.Type = scimschema.TypeFromString(string(m.text()))
+}
+
+action mark_scim_name {
+ output.scim.pos = m.p
+}
+
+action set_scim_name {
+ output.scim.Name = string(m.data[output.scim.pos:m.p])
+}
+
+action mark_scim_other {
+ output.scim.pos = m.p
+}
+
+action set_scim_other {
+ output.scim.Other = string(m.data[output.scim.pos:m.p])
+}
+
+scim_nid = 'ietf:params:scim' >mark %set_nid %create_scim $err(err_scim_nid);
+
+scim_other = ':' (sss | hex)+ >mark_scim_other %set_scim_other $err(err_scim_other);
+
+scim_name = (alnum)+ >mark_scim_name %set_scim_name $err(err_scim_name);
+
+scim_type = ('schemas' | 'api' | 'param') >mark %set_scim_type $err(err_scim_type);
+
+scim_only := pre ':' @err(err_pre) (scim_nid ':' scim_type ':' scim_name scim_other? %set_nss) %eof(scim_type);
+
+### SCIM END
+
+### 8141 BEG
+
+action err_nss_8141 {
+ m.err = fmt.Errorf(err8141SpecificString, m.p)
+ fhold;
+ fgoto fail;
+}
+
+action err_nid_8141 {
+ m.err = fmt.Errorf(err8141Identifier, m.p)
+ fhold;
+ fgoto fail;
+}
+
+action rfc8141_type {
+ output.kind = RFC8141;
+}
+
+action set_r_component {
+ output.rComponent = string(m.text())
+}
+
+action set_q_component {
+ output.qComponent = string(m.text())
+}
+
+action set_f_component {
+ output.fComponent = string(m.text())
+}
+
+action informal_nid_match {
+ fhold;
+ m.err = fmt.Errorf(err8141InformalID, m.p);
+ fgoto fail;
+}
+
+action mark_r_start {
+ if output.rStart {
+ m.err = fmt.Errorf(err8141RComponentStart, m.p)
+ fhold;
+ fgoto fail;
+ }
+ output.rStart = true
+}
+
+action mark_q_start {
+ if output.qStart {
+ m.err = fmt.Errorf(err8141QComponentStart, m.p)
+ fhold;
+ fgoto fail;
+ }
+ output.qStart = true
+}
+
+action err_malformed_r_component {
+ m.err = fmt.Errorf(err8141MalformedRComp, m.p)
+ fhold;
+ fgoto fail;
+}
+
+action err_malformed_q_component {
+ m.err = fmt.Errorf(err8141MalformedQComp, m.p)
+ fhold;
+ fgoto fail;
+}
+
+pchar = (sss | '~' | '&' | hex);
+
+component = pchar (pchar | '/' | '?')*;
+
+r_start = ('?+') %mark_r_start;
+
+r_component = r_start <: (r_start | component)+ $err(err_malformed_r_component) >mark %set_r_component;
+
+q_start = ('?=') %mark_q_start;
+
+q_component = q_start <: (q_start | component)+ $err(err_malformed_q_component) >mark %set_q_component;
+
+rq_components = (r_component :>> q_component? | q_component);
+
+fragment = (pchar | '/' | '?')*;
+
+f_component = '#' fragment >mark %set_f_component;
+
+nss_rfc8141 = (pchar >mark (pchar | '/')*) $err(err_nss_8141) %set_nss;
+
+nid_rfc8141 = (alnum >mark (alnum | '-'){0,30} alnum) $err(err_nid_8141) %set_nid;
+
+informal_id = pre ('-' [a-zA-z0] %to(informal_nid_match));
+
+nid_rfc8141_not_urn = (nid_rfc8141 - informal_id?);
+
+rfc8141_only := pre ':' @err(err_pre) nid_rfc8141_not_urn ':' nss_rfc8141 rq_components? f_component? %eof(rfc8141_type);
+
+### 8141 END
fail := (any - [\n\r])* @err{ fgoto main; };
-main := (pre ':' (nid - pre %err(err_urn)) $err(err_nid) ':' nss >mark %set_nss) $err(err_parse);
+main := urn;
}%%
@@ -103,6 +303,7 @@ main := (pre ':' (nid - pre %err(err_urn)) $err(err_nid) ':' nss >mark %set_nss)
type Machine interface {
Error() error
Parse(input []byte) (*URN, error)
+ WithParsingMode(ParsingMode)
}
type machine struct {
@@ -110,12 +311,24 @@ type machine struct {
cs int
p, pe, eof, pb int
err error
- tolower []int
+ startParsingAt int
+ parsingMode ParsingMode
+ parsingModeSet bool
}
// NewMachine creates a new FSM able to parse RFC 2141 strings.
-func NewMachine() Machine {
- m := &machine{}
+func NewMachine(options ...Option) Machine {
+ m := &machine{
+ parsingModeSet: false,
+ }
+
+ for _, o := range options {
+ o(m)
+ }
+ // Set default parsing mode
+ if !m.parsingModeSet {
+ m.WithParsingMode(DefaultParsingMode)
+ }
%% access m.;
%% variable p m.p;
@@ -137,7 +350,7 @@ func (m *machine) text() []byte {
return m.data[m.pb:m.p]
}
-// Parse parses the input byte array as a RFC 2141 string.
+// Parse parses the input byte array as a RFC 2141 or RFC7643 string.
func (m *machine) Parse(input []byte) (*URN, error) {
m.data = input
m.p = 0
@@ -145,10 +358,11 @@ func (m *machine) Parse(input []byte) (*URN, error) {
m.pe = len(input)
m.eof = len(input)
m.err = nil
- m.tolower = []int{}
- output := &URN{}
+ m.cs = m.startParsingAt
+ output := &URN{
+ tolower: []int{},
+ }
- %% write init;
%% write exec;
if m.cs < first_final || m.cs == en_fail {
@@ -157,3 +371,16 @@ func (m *machine) Parse(input []byte) (*URN, error) {
return output, nil
}
+
+func (m *machine) WithParsingMode(x ParsingMode) {
+ m.parsingMode = x
+ switch m.parsingMode {
+ case RFC2141Only:
+ m.startParsingAt = en_main
+ case RFC8141Only:
+ m.startParsingAt = en_rfc8141_only
+ case RFC7643Only:
+ m.startParsingAt = en_scim_only
+ }
+ m.parsingModeSet = true
+}
\ No newline at end of file
diff --git a/vendor/github.com/leodido/go-urn/makefile b/vendor/github.com/leodido/go-urn/makefile
index 47026d5099..68d5dd0f1b 100644
--- a/vendor/github.com/leodido/go-urn/makefile
+++ b/vendor/github.com/leodido/go-urn/makefile
@@ -1,18 +1,43 @@
SHELL := /bin/bash
+RAGEL := ragel
+GOFMT := go fmt
+export GO_TEST=env GOTRACEBACK=all go test $(GO_ARGS)
+
+.PHONY: build
build: machine.go
+.PHONY: clean
+clean:
+ @rm -rf docs
+ @rm -f machine.go
+
+.PHONY: images
images: docs/urn.png
+.PHONY: snake2camel
+snake2camel:
+ @cd ./tools/snake2camel; go build -o ../../snake2camel .
+
+.PHONY: removecomments
+removecomments:
+ @cd ./tools/removecomments; go build -o ../../removecomments .
+
machine.go: machine.go.rl
- ragel -Z -G2 -e -o $@ $<
- @sed -i '/^\/\/line/d' $@
- @$(MAKE) -s file=$@ snake2camel
- @gofmt -w -s $@
+
+machine.go: snake2camel
+
+machine.go: removecomments
+
+machine.go:
+ $(RAGEL) -Z -G1 -e -o $@ $<
+ @./removecomments $@
+ @./snake2camel $@
+ $(GOFMT) $@
docs/urn.dot: machine.go.rl
@mkdir -p docs
- ragel -Z -e -Vp $< -o $@
+ $(RAGEL) -Z -e -Vp $< -o $@
docs/urn.png: docs/urn.dot
dot $< -Tpng -o $@
@@ -22,18 +47,5 @@ bench: *_test.go machine.go
go test -bench=. -benchmem -benchtime=5s ./...
.PHONY: tests
-tests: *_test.go machine.go
- go test -race -timeout 10s -coverprofile=coverage.out -covermode=atomic -v ./...
-
-.PHONY: clean
-clean:
- @rm -rf docs
- @rm -f machine.go
-
-.PHONY: snake2camel
-snake2camel:
- @awk -i inplace '{ \
- while ( match($$0, /(.*)([a-z]+[0-9]*)_([a-zA-Z0-9])(.*)/, cap) ) \
- $$0 = cap[1] cap[2] toupper(cap[3]) cap[4]; \
- print \
- }' $(file)
\ No newline at end of file
+tests: *_test.go
+ $(GO_TEST) ./...
diff --git a/vendor/github.com/leodido/go-urn/options.go b/vendor/github.com/leodido/go-urn/options.go
new file mode 100644
index 0000000000..c543835a28
--- /dev/null
+++ b/vendor/github.com/leodido/go-urn/options.go
@@ -0,0 +1,9 @@
+package urn
+
+type Option func(Machine)
+
+func WithParsingMode(mode ParsingMode) Option {
+ return func(m Machine) {
+ m.WithParsingMode(mode)
+ }
+}
diff --git a/vendor/github.com/leodido/go-urn/parsing_mode.go b/vendor/github.com/leodido/go-urn/parsing_mode.go
new file mode 100644
index 0000000000..fce5aadc3c
--- /dev/null
+++ b/vendor/github.com/leodido/go-urn/parsing_mode.go
@@ -0,0 +1,12 @@
+package urn
+
+type ParsingMode int
+
+const (
+ Default ParsingMode = iota
+ RFC2141Only
+ RFC7643Only
+ RFC8141Only
+)
+
+const DefaultParsingMode = RFC2141Only
diff --git a/vendor/github.com/leodido/go-urn/scim.go b/vendor/github.com/leodido/go-urn/scim.go
new file mode 100644
index 0000000000..f6b7aefbad
--- /dev/null
+++ b/vendor/github.com/leodido/go-urn/scim.go
@@ -0,0 +1,48 @@
+package urn
+
+import (
+ "encoding/json"
+ "fmt"
+
+ scimschema "github.com/leodido/go-urn/scim/schema"
+)
+
+const errInvalidSCIMURN = "invalid SCIM URN: %s"
+
+type SCIM struct {
+ Type scimschema.Type
+ Name string
+ Other string
+ pos int
+}
+
+func (s SCIM) MarshalJSON() ([]byte, error) {
+ return json.Marshal(s.String())
+}
+
+func (s *SCIM) UnmarshalJSON(bytes []byte) error {
+ var str string
+ if err := json.Unmarshal(bytes, &str); err != nil {
+ return err
+ }
+ // Parse as SCIM
+ value, ok := Parse([]byte(str), WithParsingMode(RFC7643Only))
+ if !ok {
+ return fmt.Errorf(errInvalidSCIMURN, str)
+ }
+ if value.RFC() != RFC7643 {
+ return fmt.Errorf(errInvalidSCIMURN, str)
+ }
+ *s = *value.SCIM()
+
+ return nil
+}
+
+func (s *SCIM) String() string {
+ ret := fmt.Sprintf("urn:ietf:params:scim:%s:%s", s.Type.String(), s.Name)
+ if s.Other != "" {
+ ret += fmt.Sprintf(":%s", s.Other)
+ }
+
+ return ret
+}
diff --git a/vendor/github.com/leodido/go-urn/scim/schema/type.go b/vendor/github.com/leodido/go-urn/scim/schema/type.go
new file mode 100644
index 0000000000..134918230f
--- /dev/null
+++ b/vendor/github.com/leodido/go-urn/scim/schema/type.go
@@ -0,0 +1,36 @@
+package scimschema
+
+type Type int
+
+const (
+ Unsupported Type = iota
+ Schemas
+ API
+ Param
+)
+
+func (t Type) String() string {
+ switch t {
+ case Schemas:
+ return "schemas"
+ case API:
+ return "api"
+ case Param:
+ return "param"
+ }
+
+ return ""
+}
+
+func TypeFromString(input string) Type {
+ switch input {
+ case "schemas":
+ return Schemas
+ case "api":
+ return API
+ case "param":
+ return Param
+ }
+
+ return Unsupported
+}
diff --git a/vendor/github.com/leodido/go-urn/urn.go b/vendor/github.com/leodido/go-urn/urn.go
index b903b7b3cd..894d6258dc 100644
--- a/vendor/github.com/leodido/go-urn/urn.go
+++ b/vendor/github.com/leodido/go-urn/urn.go
@@ -1,9 +1,13 @@
package urn
import (
+ "encoding/json"
+ "fmt"
"strings"
)
+const errInvalidURN = "invalid URN: %s"
+
// URN represents an Uniform Resource Name.
//
// The general form represented is:
@@ -12,10 +16,18 @@ import (
//
// Details at https://tools.ietf.org/html/rfc2141.
type URN struct {
- prefix string // Static prefix. Equal to "urn" when empty.
- ID string // Namespace identifier
- SS string // Namespace specific string
- norm string // Normalized namespace specific string
+ prefix string // Static prefix. Equal to "urn" when empty.
+ ID string // Namespace identifier (NID)
+ SS string // Namespace specific string (NSS)
+ norm string // Normalized namespace specific string
+ kind Kind
+ scim *SCIM
+ rComponent string // RFC8141
+ qComponent string // RFC8141
+ fComponent string // RFC8141
+ rStart bool // RFC8141
+ qStart bool // RFC8141
+ tolower []int
}
// Normalize turns the receiving URN into its norm version.
@@ -26,12 +38,21 @@ func (u *URN) Normalize() *URN {
prefix: "urn",
ID: strings.ToLower(u.ID),
SS: u.norm,
+ // rComponent: u.rComponent,
+ // qComponent: u.qComponent,
+ // fComponent: u.fComponent,
}
}
// Equal checks the lexical equivalence of the current URN with another one.
func (u *URN) Equal(x *URN) bool {
- return *u.Normalize() == *x.Normalize()
+ if x == nil {
+ return false
+ }
+ nu := u.Normalize()
+ nx := x.Normalize()
+
+ return nu.prefix == nx.prefix && nu.ID == nx.ID && nu.SS == nx.SS
}
// String reassembles the URN into a valid URN string.
@@ -47,17 +68,74 @@ func (u *URN) String() string {
res += "urn"
}
res += u.prefix + ":" + u.ID + ":" + u.SS
+ if u.rComponent != "" {
+ res += "?+" + u.rComponent
+ }
+ if u.qComponent != "" {
+ res += "?=" + u.qComponent
+ }
+ if u.fComponent != "" {
+ res += "#" + u.fComponent
+ }
}
return res
}
-// Parse is responsible to create an URN instance from a byte array matching the correct URN syntax.
-func Parse(u []byte) (*URN, bool) {
- urn, err := NewMachine().Parse(u)
+// Parse is responsible to create an URN instance from a byte array matching the correct URN syntax (RFC 2141).
+func Parse(u []byte, options ...Option) (*URN, bool) {
+ urn, err := NewMachine(options...).Parse(u)
if err != nil {
return nil, false
}
return urn, true
}
+
+// MarshalJSON marshals the URN to JSON string form (e.g. `"urn:oid:1.2.3.4"`).
+func (u URN) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+// UnmarshalJSON unmarshals a URN from JSON string form (e.g. `"urn:oid:1.2.3.4"`).
+func (u *URN) UnmarshalJSON(bytes []byte) error {
+ var str string
+ if err := json.Unmarshal(bytes, &str); err != nil {
+ return err
+ }
+ if value, ok := Parse([]byte(str)); !ok {
+ return fmt.Errorf(errInvalidURN, str)
+ } else {
+ *u = *value
+ }
+
+ return nil
+}
+
+func (u *URN) IsSCIM() bool {
+ return u.kind == RFC7643
+}
+
+func (u *URN) SCIM() *SCIM {
+ if u.kind != RFC7643 {
+ return nil
+ }
+
+ return u.scim
+}
+
+func (u *URN) RFC() Kind {
+ return u.kind
+}
+
+func (u *URN) FComponent() string {
+ return u.fComponent
+}
+
+func (u *URN) QComponent() string {
+ return u.qComponent
+}
+
+func (u *URN) RComponent() string {
+ return u.rComponent
+}
diff --git a/vendor/github.com/leodido/go-urn/urn8141.go b/vendor/github.com/leodido/go-urn/urn8141.go
new file mode 100644
index 0000000000..da4dd062e3
--- /dev/null
+++ b/vendor/github.com/leodido/go-urn/urn8141.go
@@ -0,0 +1,30 @@
+package urn
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+const errInvalidURN8141 = "invalid URN per RFC 8141: %s"
+
+type URN8141 struct {
+ *URN
+}
+
+func (u URN8141) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+func (u *URN8141) UnmarshalJSON(bytes []byte) error {
+ var str string
+ if err := json.Unmarshal(bytes, &str); err != nil {
+ return err
+ }
+ if value, ok := Parse([]byte(str), WithParsingMode(RFC8141Only)); !ok {
+ return fmt.Errorf(errInvalidURN8141, str)
+ } else {
+ *u = URN8141{value}
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/posthog/posthog-go/.gitignore b/vendor/github.com/posthog/posthog-go/.gitignore
index 942678bd91..aefc4fd5cd 100644
--- a/vendor/github.com/posthog/posthog-go/.gitignore
+++ b/vendor/github.com/posthog/posthog-go/.gitignore
@@ -6,6 +6,7 @@
# Folders
_obj
_test
+.idea
# Architecture specific extensions/prefixes
*.[568vq]
diff --git a/vendor/github.com/posthog/posthog-go/CHANGELOG.md b/vendor/github.com/posthog/posthog-go/CHANGELOG.md
new file mode 100644
index 0000000000..e7383fbfc0
--- /dev/null
+++ b/vendor/github.com/posthog/posthog-go/CHANGELOG.md
@@ -0,0 +1,128 @@
+## 1.4.1
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.4.0...v1.4.1)
+
+## 1.4.0
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.3.3...v1.4.0)
+
+## 1.3.3
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.3.2...v1.3.3)
+
+## 1.3.2
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.3.1...v1.3.2)
+
+## 1.3.1
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.3.0...v1.3.1)
+
+## 1.2.24
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.23...v1.2.24)
+
+## 1.2.23
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.22...v1.2.23)
+
+## 1.2.22
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.21...v1.2.22)
+
+## 1.2.21
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.20...v1.2.21)
+
+## 1.2.20
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.19...v1.2.20)
+
+## 1.2.19
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.18...v1.2.19)
+
+## 1.2.18
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.17...v1.2.18)
+
+## 1.2.17
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.16...v1.2.17)
+
+## 1.2.16
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.15...v1.2.16)
+
+## 1.2.15
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.14...v1.2.15)
+
+## 1.2.14
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.13...v1.2.14)
+
+## 1.2.13
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v1.2.12...v1.2.13)
+
+## 1.2.12
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.12)
+
+## 1.2.11
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.11)
+
+## 1.2.10
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.10)
+
+## 1.2.9
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.9)
+
+## 1.2.8
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.8)
+
+## 1.2.7
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.7)
+
+## 1.2.6
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.6)
+
+## 1.2.5
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.5)
+
+## 1.2.4
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.4)
+
+## 1.2.3
+
+* [Full Changelog](https://github.com/PostHog/posthog-go/compare/v...v1.2.3)
+
+# Changelog
+
+## 1.2.2 - 2024-08-08
+
+1. Adds logging to error responses from the PostHog API so that users can see how a call failed (e.g. rate limiting) from the SDK itself.
+2. Better string formatting in `poller.Errorf`
+
+## 1.2.1 - 2024-08-07
+
+1. The client will fall back to the `/decide` endpoint when evaluating feature flags if the user does not wish to provide a PersonalApiKey. This fixes an issue where users were unable to use this SDK without providing a PersonalApiKey. This fallback will make feature flag usage less performant, but will save users money by not making them pay for public API access.
+
+## 1.2.0 - 2022-08-15
+
+Breaking changes:
+
+1. Minimum PostHog version requirement: 1.38
+2. Local Evaluation added to IsFeatureEnabled and GetFeatureFlag. These functions now accept person and group properties arguments. The arguments will be used to locally evaluate relevant feature flags.
+3. Feature flag functions take a payload called `FeatureFlagPayload` when a key is require and `FeatureFlagPayloadNoKey` when a key is not required. The payload will handle defaults for all unspecified arguments automatically.
+3. Feature Flag defaults have been removed. If the flag fails for any reason, nil will be returned.
+4. GetAllFlags argument added. This function returns all flags related to the id.
diff --git a/vendor/github.com/posthog/posthog-go/README.md b/vendor/github.com/posthog/posthog-go/README.md
index 53558ce403..fa80848c44 100644
--- a/vendor/github.com/posthog/posthog-go/README.md
+++ b/vendor/github.com/posthog/posthog-go/README.md
@@ -21,7 +21,15 @@ import (
)
func main() {
- client := posthog.New(os.Getenv("POSTHOG_API_KEY"))
+ client := posthog.New(os.Getenv("POSTHOG_API_KEY")) // This value must be set to the project API key in PostHog
+ // alternatively, you can do
+ // client, _ := posthog.NewWithConfig(
+ // os.Getenv("POSTHOG_API_KEY"),
+ // posthog.Config{
+ // PersonalApiKey: "your personal API key", // Set this to your personal API token you want feature flag evaluation to be more performant. This will incur more costs, though
+ // Endpoint: "https://us.i.posthog.com",
+ // },
+ // )
defer client.Close()
// Capture an event
@@ -44,7 +52,7 @@ func main() {
// Link user contexts
client.Enqueue(posthog.Alias{
DistinctId: "user:123",
- Alias: "user:12345"
+ Alias: "user:12345",
})
// Capture a pageview
@@ -54,10 +62,49 @@ func main() {
Properties: posthog.NewProperties().
Set("$current_url", "https://example.com"),
})
+
+ // Capture event with calculated uuid to deduplicate repeated events.
+ // The library github.com/google/uuid is used
+ key := myEvent.Id + myEvent.Project
+ uid := uuid.NewSHA1(uuid.NameSpaceX500, []byte(key)).String()
+ client.Enqueue(posthog.Capture{
+ Uuid: uid,
+ DistinctId: "test-user",
+ Event: "$pageview",
+ Properties: posthog.NewProperties().
+ Set("$current_url", "https://example.com"),
+ })
+
+ // Check if a feature flag is enabled
+ isMyFlagEnabled, err := client.IsFeatureEnabled(
+ FeatureFlagPayload{
+ Key: "flag-key",
+ DistinctId: "distinct_id_of_your_user",
+ })
+
+ if isMyFlagEnabled == true {
+ // Do something differently for this user
+ }
}
```
+## Testing Locally
+
+You can run your Go app against a local build of `posthog-go` by making the following change to your `go.mod` file for whichever your app, e.g.
+
+```Go
+module example/posthog-go-app
+
+go 1.22.5
+
+require github.com/posthog/posthog-go v0.0.0-20240327112532-87b23fe11103
+
+require github.com/google/uuid v1.3.0 // indirect
+
+replace github.com/posthog/posthog-go => /path-to-your-local/posthog-go
+```
+
## Questions?
-### [Join our Slack community.](https://join.slack.com/t/posthogusers/shared_invite/enQtOTY0MzU5NjAwMDY3LTc2MWQ0OTZlNjhkODk3ZDI3NDVjMDE1YjgxY2I4ZjI4MzJhZmVmNjJkN2NmMGJmMzc2N2U3Yjc3ZjI5NGFlZDQ)
+### [Visit the community forum.](https://posthog.com/questions)
diff --git a/vendor/github.com/posthog/posthog-go/backo.go b/vendor/github.com/posthog/posthog-go/backo.go
index 184452184c..2b730df97b 100644
--- a/vendor/github.com/posthog/posthog-go/backo.go
+++ b/vendor/github.com/posthog/posthog-go/backo.go
@@ -19,10 +19,11 @@ func NewBacko(base time.Duration, factor uint8, jitter float64, cap time.Duratio
}
// Creates a backo instance with the following defaults:
-// base: 100 milliseconds
-// factor: 2
-// jitter: 0
-// cap: 10 seconds
+//
+// base: 100 milliseconds
+// factor: 2
+// jitter: 0
+// cap: 10 seconds
func DefaultBacko() *Backo {
return NewBacko(time.Millisecond*100, 2, 0, time.Second*10)
}
diff --git a/vendor/github.com/posthog/posthog-go/capture.go b/vendor/github.com/posthog/posthog-go/capture.go
index 980df81e6f..31db77d110 100644
--- a/vendor/github.com/posthog/posthog-go/capture.go
+++ b/vendor/github.com/posthog/posthog-go/capture.go
@@ -9,11 +9,15 @@ type Capture struct {
// This field is exported for serialization purposes and shouldn't be set by
// the application, its value is always overwritten by the library.
Type string
-
- DistinctId string
- Event string
- Timestamp time.Time
- Properties Properties
+ // You don't usually need to specify this field - Posthog will generate it automatically.
+ // Use it only when necessary - for example, to prevent duplicate events.
+ Uuid string
+ DistinctId string
+ Event string
+ Timestamp time.Time
+ Properties Properties
+ Groups Groups
+ SendFeatureFlags bool
}
func (msg Capture) internal() {
@@ -42,13 +46,15 @@ func (msg Capture) Validate() error {
type CaptureInApi struct {
Type string `json:"type"`
+ Uuid string `json:"uuid"`
Library string `json:"library"`
LibraryVersion string `json:"library_version"`
Timestamp time.Time `json:"timestamp"`
- DistinctId string `json:"distinct_id"`
- Event string `json:"event"`
- Properties Properties `json:"properties"`
+ DistinctId string `json:"distinct_id"`
+ Event string `json:"event"`
+ Properties Properties `json:"properties"`
+ SendFeatureFlags bool `json:"send_feature_flags"`
}
func (msg Capture) APIfy() APIMessage {
@@ -63,8 +69,13 @@ func (msg Capture) APIfy() APIMessage {
}
}
+ if msg.Groups != nil {
+ myProperties.Set("$groups", msg.Groups)
+ }
+
apified := CaptureInApi{
Type: msg.Type,
+ Uuid: msg.Uuid,
Library: library,
LibraryVersion: libraryVersion,
Timestamp: msg.Timestamp,
diff --git a/vendor/github.com/posthog/posthog-go/config.go b/vendor/github.com/posthog/posthog-go/config.go
index cdd56c2a3e..46d11ce753 100644
--- a/vendor/github.com/posthog/posthog-go/config.go
+++ b/vendor/github.com/posthog/posthog-go/config.go
@@ -1,7 +1,6 @@
package posthog
import (
- "github.com/xtgo/uuid"
"net/http"
"time"
)
@@ -17,8 +16,11 @@ type Config struct {
// `DefaultEndpoint` by default.
Endpoint string
- // You must specify a Personal API Key to use feature flags
- // More information on how to get one: https://posthog.com/docs/api/overview
+ // Specifying a Personal API key will make feature flag evaluation more performant,
+ // but it's not required for feature flags. If you don't have a personal API key,
+ // you can leave this field empty, and all of the relevant feature flag evaluation
+ // methods will still work.
+ // Information on how to get a personal API key: https://posthog.com/docs/api/overview
PersonalApiKey string
// The flushing interval of the client. Messages will be sent when they've
@@ -26,9 +28,20 @@ type Config struct {
// timer triggers.
Interval time.Duration
- // Interval at which to fetch new feature flags, 5min by default
+ // Interval at which to fetch new feature flag definitions, 5min by default
DefaultFeatureFlagsPollingInterval time.Duration
+ // Timeout for fetching feature flags, 3 seconds by default
+ FeatureFlagRequestTimeout time.Duration
+
+ // Calculate when feature flag definitions should be polled next. Setting this property
+ // will override DefaultFeatureFlagsPollingInterval.
+ NextFeatureFlagsPollingTick func() time.Duration
+
+ // Flag to enable historical migration
+ // See more in our migration docs: https://posthog.com/docs/migrate
+ HistoricalMigration bool
+
// The HTTP transport used by the client, this allows an application to
// redefine how requests are being sent at the HTTP level (for example,
// to change the connection pooling policy).
@@ -41,6 +54,11 @@ type Config struct {
// `os.Stderr`.
Logger Logger
+ // Properties that will be included in every event sent by the client.
+ // This is useful for adding common metadata like service name or app version across all events.
+ // If a property conflict occurs, the value from DefaultEventProperties will overwrite any existing value.
+ DefaultEventProperties Properties
+
// The callback object that will be used by the client to notify the
// application when messages sends to the backend API succeeded or failed.
Callback Callback
@@ -63,25 +81,19 @@ type Config struct {
// If not set the client will fallback to use a default retry policy.
RetryAfter func(int) time.Duration
- // A function called by the client to generate unique message identifiers.
- // The client uses a UUID generator if none is provided.
- // This field is not exported and only exposed internally to let unit tests
- // mock the id generation.
- uid func() string
-
// A function called by the client to get the current time, `time.Now` is
// used by default.
- // This field is not exported and only exposed internally to let unit tests
- // mock the current time.
+ // This field is not exported and only exposed internally to control concurrency.
now func() time.Time
// The maximum number of goroutines that will be spawned by a client to send
// requests to the backend API.
- // This field is not exported and only exposed internally to let unit tests
- // mock the current time.
+ // This field is not exported and only exposed internally to control concurrency.
maxConcurrentRequests int
}
+const SdkName = "posthog-go"
+
// This constant sets the default endpoint to which client instances send
// messages if none was explictly set.
const DefaultEndpoint = "https://app.posthog.com"
@@ -93,6 +105,9 @@ const DefaultInterval = 5 * time.Second
// Specifies the default interval at which to fetch new feature flags
const DefaultFeatureFlagsPollingInterval = 5 * time.Minute
+// Specifies the default timeout for fetching feature flags
+const DefaultFeatureFlagRequestTimeout = 3 * time.Second
+
// This constant sets the default batch size used by client instances if none
// was explicitly set.
const DefaultBatchSize = 250
@@ -131,7 +146,11 @@ func makeConfig(c Config) Config {
}
if c.DefaultFeatureFlagsPollingInterval == 0 {
- c.DefaultFeatureFlagsPollingInterval = DefaultInterval
+ c.DefaultFeatureFlagsPollingInterval = DefaultFeatureFlagsPollingInterval
+ }
+
+ if c.FeatureFlagRequestTimeout == 0 {
+ c.FeatureFlagRequestTimeout = DefaultFeatureFlagRequestTimeout
}
if c.Transport == nil {
@@ -150,10 +169,6 @@ func makeConfig(c Config) Config {
c.RetryAfter = DefaultBacko().Duration
}
- if c.uid == nil {
- c.uid = uid
- }
-
if c.now == nil {
c.now = time.Now
}
@@ -164,9 +179,3 @@ func makeConfig(c Config) Config {
return c
}
-
-// This function returns a string representation of a UUID, it's the default
-// function used for generating unique IDs.
-func uid() string {
- return uuid.NewRandom().String()
-}
diff --git a/vendor/github.com/posthog/posthog-go/feature_flag_config.go b/vendor/github.com/posthog/posthog-go/feature_flag_config.go
new file mode 100644
index 0000000000..4bbc430c20
--- /dev/null
+++ b/vendor/github.com/posthog/posthog-go/feature_flag_config.go
@@ -0,0 +1,84 @@
+package posthog
+
+type FeatureFlagPayload struct {
+ Key string
+ DistinctId string
+ Groups Groups
+ PersonProperties Properties
+ GroupProperties map[string]Properties
+ OnlyEvaluateLocally bool
+ SendFeatureFlagEvents *bool
+}
+
+func (c *FeatureFlagPayload) validate() error {
+ if len(c.Key) == 0 {
+ return ConfigError{
+ Reason: "Feature Flag Key required",
+ Field: "Key",
+ Value: c.Key,
+ }
+ }
+
+ if len(c.DistinctId) == 0 {
+ return ConfigError{
+ Reason: "DistinctId required",
+ Field: "Distinct Id",
+ Value: c.DistinctId,
+ }
+ }
+
+ if c.Groups == nil {
+ c.Groups = Groups{}
+ }
+
+ if c.PersonProperties == nil {
+ c.PersonProperties = NewProperties()
+ }
+
+ if c.GroupProperties == nil {
+ c.GroupProperties = map[string]Properties{}
+ }
+
+ if c.SendFeatureFlagEvents == nil {
+ tempTrue := true
+ c.SendFeatureFlagEvents = &tempTrue
+ }
+ return nil
+}
+
+type FeatureFlagPayloadNoKey struct {
+ DistinctId string
+ Groups Groups
+ PersonProperties Properties
+ GroupProperties map[string]Properties
+ OnlyEvaluateLocally bool
+ SendFeatureFlagEvents *bool
+}
+
+func (c *FeatureFlagPayloadNoKey) validate() error {
+ if len(c.DistinctId) == 0 {
+ return ConfigError{
+ Reason: "DistinctId required",
+ Field: "Distinct Id",
+ Value: c.DistinctId,
+ }
+ }
+
+ if c.Groups == nil {
+ c.Groups = Groups{}
+ }
+
+ if c.PersonProperties == nil {
+ c.PersonProperties = NewProperties()
+ }
+
+ if c.GroupProperties == nil {
+ c.GroupProperties = map[string]Properties{}
+ }
+
+ if c.SendFeatureFlagEvents == nil {
+ tempTrue := true
+ c.SendFeatureFlagEvents = &tempTrue
+ }
+ return nil
+}
diff --git a/vendor/github.com/posthog/posthog-go/featureflags.go b/vendor/github.com/posthog/posthog-go/featureflags.go
index 67ec9f04de..60de934d05 100644
--- a/vendor/github.com/posthog/posthog-go/featureflags.go
+++ b/vendor/github.com/posthog/posthog-go/featureflags.go
@@ -2,13 +2,18 @@ package posthog
import (
"bytes"
+ "context"
"crypto/sha1"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
+ "net/url"
+ "regexp"
+ "sort"
"strconv"
+ "strings"
"sync"
"time"
)
@@ -16,52 +21,129 @@ import (
const LONG_SCALE = 0xfffffffffffffff
type FeatureFlagsPoller struct {
- ticker *time.Ticker // periodic ticker
- loaded chan bool
- shutdown chan bool
- forceReload chan bool
- featureFlags []FeatureFlag
- personalApiKey string
- projectApiKey string
- Errorf func(format string, args ...interface{})
- Endpoint string
- http http.Client
- mutex sync.RWMutex
- fetchedFlagsSuccessfullyOnce bool
+ loaded chan bool
+ shutdown chan bool
+ forceReload chan bool
+ featureFlags []FeatureFlag
+ cohorts map[string]PropertyGroup
+ groups map[string]string
+ personalApiKey string
+ projectApiKey string
+ Errorf func(format string, args ...interface{})
+ Endpoint string
+ http http.Client
+ mutex sync.RWMutex
+ nextPollTick func() time.Duration
+ flagTimeout time.Duration
}
type FeatureFlag struct {
+ Key string `json:"key"`
+ IsSimpleFlag bool `json:"is_simple_flag"`
+ RolloutPercentage *uint8 `json:"rollout_percentage"`
+ Active bool `json:"active"`
+ Filters Filter `json:"filters"`
+ EnsureExperienceContinuity *bool `json:"ensure_experience_continuity"`
+}
+
+type Filter struct {
+ AggregationGroupTypeIndex *uint8 `json:"aggregation_group_type_index"`
+ Groups []FeatureFlagCondition `json:"groups"`
+ Multivariate *Variants `json:"multivariate"`
+ Payloads map[string]string `json:"payloads"`
+}
+
+type Variants struct {
+ Variants []FlagVariant `json:"variants"`
+}
+
+type FlagVariant struct {
Key string `json:"key"`
- IsSimpleFlag bool `json:"is_simple_flag"`
+ Name string `json:"name"`
RolloutPercentage *uint8 `json:"rollout_percentage"`
}
+type FeatureFlagCondition struct {
+ Properties []FlagProperty `json:"properties"`
+ RolloutPercentage *uint8 `json:"rollout_percentage"`
+ Variant *string `json:"variant"`
+}
+
+type FlagProperty struct {
+ Key string `json:"key"`
+ Operator string `json:"operator"`
+ Value interface{} `json:"value"`
+ Type string `json:"type"`
+ Negation bool `json:"negation"`
+}
+
+type PropertyGroup struct {
+ Type string `json:"type"`
+ // []PropertyGroup or []FlagProperty
+ Values []any `json:"values"`
+}
+
+type FlagVariantMeta struct {
+ ValueMin float64
+ ValueMax float64
+ Key string
+}
+
type FeatureFlagsResponse struct {
- Results []FeatureFlag `json:"results"`
+ Flags []FeatureFlag `json:"flags"`
+ GroupTypeMapping *map[string]string `json:"group_type_mapping"`
+ Cohorts map[string]PropertyGroup `json:"cohorts"`
}
type DecideRequestData struct {
- ApiKey string `json:"api_key"`
- DistinctId string `json:"distinct_id"`
+ ApiKey string `json:"api_key"`
+ DistinctId string `json:"distinct_id"`
+ Groups Groups `json:"groups"`
+ PersonProperties Properties `json:"person_properties"`
+ GroupProperties map[string]Properties `json:"group_properties"`
}
type DecideResponse struct {
- FeatureFlags []string `json:"featureFlags"`
+ FeatureFlags map[string]interface{} `json:"featureFlags"`
+ FeatureFlagPayloads map[string]string `json:"featureFlagPayloads"`
+ QuotaLimited *[]string `json:"quota_limited"`
+}
+
+type InconclusiveMatchError struct {
+ msg string
+}
+
+func (e *InconclusiveMatchError) Error() string {
+ return e.msg
}
-func newFeatureFlagsPoller(projectApiKey string, personalApiKey string, errorf func(format string, args ...interface{}), endpoint string, httpClient http.Client, pollingInterval time.Duration) *FeatureFlagsPoller {
+func newFeatureFlagsPoller(
+ projectApiKey string,
+ personalApiKey string,
+ errorf func(format string, args ...interface{}),
+ endpoint string,
+ httpClient http.Client,
+ pollingInterval time.Duration,
+ nextPollTick func() time.Duration,
+ flagTimeout time.Duration,
+) *FeatureFlagsPoller {
+
+ if nextPollTick == nil {
+ nextPollTick = func() time.Duration { return pollingInterval }
+ }
+
poller := FeatureFlagsPoller{
- ticker: time.NewTicker(pollingInterval),
- loaded: make(chan bool),
- shutdown: make(chan bool),
- forceReload: make(chan bool),
- personalApiKey: personalApiKey,
- projectApiKey: projectApiKey,
- Errorf: errorf,
- Endpoint: endpoint,
- http: httpClient,
- mutex: sync.RWMutex{},
- fetchedFlagsSuccessfullyOnce: false,
+ loaded: make(chan bool),
+ shutdown: make(chan bool),
+ forceReload: make(chan bool),
+ personalApiKey: personalApiKey,
+ projectApiKey: projectApiKey,
+ Errorf: errorf,
+ Endpoint: endpoint,
+ http: httpClient,
+ mutex: sync.RWMutex{},
+ nextPollTick: nextPollTick,
+ flagTimeout: flagTimeout,
}
go poller.run()
@@ -70,18 +152,20 @@ func newFeatureFlagsPoller(projectApiKey string, personalApiKey string, errorf f
func (poller *FeatureFlagsPoller) run() {
poller.fetchNewFeatureFlags()
+ close(poller.loaded)
for {
+ timer := time.NewTimer(poller.nextPollTick())
select {
case <-poller.shutdown:
close(poller.shutdown)
close(poller.forceReload)
- close(poller.loaded)
- poller.ticker.Stop()
+ timer.Stop()
return
case <-poller.forceReload:
+ timer.Stop()
poller.fetchNewFeatureFlags()
- case <-poller.ticker.C:
+ case <-timer.C:
poller.fetchNewFeatureFlags()
}
}
@@ -89,111 +173,665 @@ func (poller *FeatureFlagsPoller) run() {
func (poller *FeatureFlagsPoller) fetchNewFeatureFlags() {
personalApiKey := poller.personalApiKey
- requestData := []byte{}
headers := [][2]string{{"Authorization", "Bearer " + personalApiKey + ""}}
- res, err := poller.request("GET", "api/feature_flag", requestData, headers)
- if err != nil || res.StatusCode != http.StatusOK {
- poller.Errorf("Unable to fetch feature flags", err)
+ res, cancel, err := poller.localEvaluationFlags(headers)
+ defer cancel()
+ if err != nil {
+ poller.Errorf("Unable to fetch feature flags: %s", err)
+ return
+ }
+
+ // Handle quota limit response (HTTP 402)
+ if res.StatusCode == http.StatusPaymentRequired {
+ // Clear existing flags when quota limited
+ poller.mutex.Lock()
+ poller.featureFlags = []FeatureFlag{}
+ poller.cohorts = map[string]PropertyGroup{}
+ poller.groups = map[string]string{}
+ poller.mutex.Unlock()
+ poller.Errorf("[FEATURE FLAGS] PostHog feature flags quota limited, resetting feature flag data. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts")
+ return
+ }
+
+ if res.StatusCode != http.StatusOK {
+ poller.Errorf("Unable to fetch feature flags, status: %s", res.Status)
+ return
}
+
defer res.Body.Close()
resBody, err := ioutil.ReadAll(res.Body)
if err != nil {
- poller.Errorf("Unable to fetch feature flags", err)
+ poller.Errorf("Unable to fetch feature flags: %s", err)
return
}
featureFlagsResponse := FeatureFlagsResponse{}
err = json.Unmarshal([]byte(resBody), &featureFlagsResponse)
if err != nil {
- poller.Errorf("Unable to unmarshal response from api/feature_flag", err)
+ poller.Errorf("Unable to unmarshal response from api/feature_flag/local_evaluation: %s", err)
return
}
+ newFlags := []FeatureFlag{}
+ newFlags = append(newFlags, featureFlagsResponse.Flags...)
poller.mutex.Lock()
- if !poller.fetchedFlagsSuccessfullyOnce {
- poller.loaded <- true
+ poller.featureFlags = newFlags
+ poller.cohorts = featureFlagsResponse.Cohorts
+ if featureFlagsResponse.GroupTypeMapping != nil {
+ poller.groups = *featureFlagsResponse.GroupTypeMapping
}
- poller.featureFlags = featureFlagsResponse.Results
poller.mutex.Unlock()
+}
+
+func (poller *FeatureFlagsPoller) GetFeatureFlag(flagConfig FeatureFlagPayload) (interface{}, error) {
+ flag, err := poller.getFeatureFlag(flagConfig)
+
+ var result interface{}
+
+ if flag.Key != "" {
+ result, err = poller.computeFlagLocally(
+ flag,
+ flagConfig.DistinctId,
+ flagConfig.Groups,
+ flagConfig.PersonProperties,
+ flagConfig.GroupProperties,
+ poller.cohorts,
+ )
+ }
+
+ if err != nil {
+ poller.Errorf("Unable to compute flag locally (%s) - %s", flag.Key, err)
+ }
+ if (err != nil || result == nil) && !flagConfig.OnlyEvaluateLocally {
+
+ result, err = poller.getFeatureFlagVariant(flag, flagConfig.Key, flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties)
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ return result, err
}
-func (poller *FeatureFlagsPoller) IsFeatureEnabled(key string, distinctId string, defaultResult bool) (bool, error) {
- featureFlags := poller.GetFeatureFlags()
- errorMessage := "Failed when checking if flag is enabled"
+func (poller *FeatureFlagsPoller) GetFeatureFlagPayload(flagConfig FeatureFlagPayload) (string, error) {
+ flag, err := poller.getFeatureFlag(flagConfig)
+
+ var variant interface{}
+
+ if flag.Key != "" {
+ variant, err = poller.computeFlagLocally(
+ flag,
+ flagConfig.DistinctId,
+ flagConfig.Groups,
+ flagConfig.PersonProperties,
+ flagConfig.GroupProperties,
+ poller.cohorts,
+ )
+ }
+ if err != nil {
+ poller.Errorf("Unable to compute flag locally (%s) - %s", flag.Key, err)
+ }
+
+ if variant != nil {
+ payload, ok := flag.Filters.Payloads[fmt.Sprintf("%v", variant)]
+ if ok {
+ return payload, nil
+ }
+ }
+
+ if (variant == nil || err != nil) && !flagConfig.OnlyEvaluateLocally {
+ result, err := poller.getFeatureFlagPayload(flagConfig.Key, flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties)
+ if err != nil {
+ return "", err
+ }
+
+ return result, nil
+ }
+
+ return "", errors.New("unable to compute flag locally")
+}
- if len(featureFlags) < 1 {
- return defaultResult, nil
+func (poller *FeatureFlagsPoller) getFeatureFlag(flagConfig FeatureFlagPayload) (FeatureFlag, error) {
+ featureFlags, err := poller.GetFeatureFlags()
+ if err != nil {
+ return FeatureFlag{}, err
}
featureFlag := FeatureFlag{Key: ""}
// avoid using flag for conflicts with Golang's stdlib `flag`
for _, storedFlag := range featureFlags {
- if key == storedFlag.Key {
+ if flagConfig.Key == storedFlag.Key {
featureFlag = storedFlag
break
}
}
- if featureFlag.Key == "" {
- return defaultResult, nil
+ return featureFlag, nil
+}
+
+func (poller *FeatureFlagsPoller) GetAllFlags(flagConfig FeatureFlagPayloadNoKey) (map[string]interface{}, error) {
+ response := map[string]interface{}{}
+ featureFlags, err := poller.GetFeatureFlags()
+ if err != nil {
+ return nil, err
}
+ fallbackToDecide := false
+ cohorts := poller.cohorts
- isFlagEnabledResponse := false
+ if len(featureFlags) == 0 {
+ fallbackToDecide = true
+ } else {
+ for _, storedFlag := range featureFlags {
+ result, err := poller.computeFlagLocally(
+ storedFlag,
+ flagConfig.DistinctId,
+ flagConfig.Groups,
+ flagConfig.PersonProperties,
+ flagConfig.GroupProperties,
+ cohorts,
+ )
+ if err != nil {
+ poller.Errorf("Unable to compute flag locally (%s) - %s", storedFlag.Key, err)
+ fallbackToDecide = true
+ } else {
+ response[storedFlag.Key] = result
+ }
+ }
+ }
- if featureFlag.IsSimpleFlag {
+ if fallbackToDecide && !flagConfig.OnlyEvaluateLocally {
+ result, err := poller.getFeatureFlagVariants(flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties)
- // json.Unmarshal will convert JSON `null` to a nullish value for each type
- // which is 0 for uint. However, our feature flags should have rolloutPercentage == 100
- // if it is set to `null`. Having rollout percentage be a pointer and deferencing it
- // here allows its value to be `nil` following json.Unmarhsal, so we can appropriately
- // set it to 100
- rolloutPercentage := uint8(100)
- if featureFlag.RolloutPercentage != nil {
- rolloutPercentage = *featureFlag.RolloutPercentage
+ if err != nil {
+ return response, err
+ } else {
+ for k, v := range result.FeatureFlags {
+ response[k] = v
+ }
+ }
+ }
+
+ return response, nil
+}
+
+func (poller *FeatureFlagsPoller) computeFlagLocally(
+ flag FeatureFlag,
+ distinctId string,
+ groups Groups,
+ personProperties Properties,
+ groupProperties map[string]Properties,
+ cohorts map[string]PropertyGroup,
+) (interface{}, error) {
+ if flag.EnsureExperienceContinuity != nil && *flag.EnsureExperienceContinuity {
+ return nil, &InconclusiveMatchError{"Flag has experience continuity enabled"}
+ }
+
+ if !flag.Active {
+ return false, nil
+ }
+
+ if flag.Filters.AggregationGroupTypeIndex != nil {
+
+ groupName, exists := poller.groups[fmt.Sprintf("%d", *flag.Filters.AggregationGroupTypeIndex)]
+
+ if !exists {
+ errMessage := "flag has unknown group type index"
+ return nil, errors.New(errMessage)
+ }
+
+ _, exists = groups[groupName]
+
+ if !exists {
+ errMessage := fmt.Sprintf("FEATURE FLAGS] Can't compute group feature flag: %s without group names passed in", flag.Key)
+ return nil, errors.New(errMessage)
}
+
+ focusedGroupProperties := groupProperties[groupName]
+ return matchFeatureFlagProperties(flag, groups[groupName].(string), focusedGroupProperties, cohorts)
+ } else {
+ return matchFeatureFlagProperties(flag, distinctId, personProperties, cohorts)
+ }
+}
+
+func getMatchingVariant(flag FeatureFlag, distinctId string) (interface{}, error) {
+ lookupTable := getVariantLookupTable(flag)
+
+ hashValue, err := _hash(flag.Key, distinctId, "variant")
+ if err != nil {
+ return nil, err
+ }
+
+ for _, variant := range lookupTable {
+ if hashValue >= float64(variant.ValueMin) && hashValue < float64(variant.ValueMax) {
+ return variant.Key, nil
+ }
+ }
+
+ return true, nil
+}
+
+func getVariantLookupTable(flag FeatureFlag) []FlagVariantMeta {
+ lookupTable := []FlagVariantMeta{}
+ valueMin := 0.00
+
+ multivariates := flag.Filters.Multivariate
+
+ if multivariates == nil || multivariates.Variants == nil {
+ return lookupTable
+ }
+
+ for _, variant := range multivariates.Variants {
+ valueMax := float64(valueMin) + float64(*variant.RolloutPercentage)/100
+ _flagVariantMeta := FlagVariantMeta{ValueMin: float64(valueMin), ValueMax: valueMax, Key: variant.Key}
+ lookupTable = append(lookupTable, _flagVariantMeta)
+ valueMin = float64(valueMax)
+ }
+
+ return lookupTable
+}
+
+func matchFeatureFlagProperties(
+ flag FeatureFlag,
+ distinctId string,
+ properties Properties,
+ cohorts map[string]PropertyGroup,
+) (interface{}, error) {
+ conditions := flag.Filters.Groups
+ isInconclusive := false
+
+ // # Stable sort conditions with variant overrides to the top. This ensures that if overrides are present, they are
+ // # evaluated first, and the variant override is applied to the first matching condition.
+ // conditionsCopy := make([]PropertyGroup, len(conditions))
+ sortedConditions := append([]FeatureFlagCondition{}, conditions...)
+
+ sort.SliceStable(sortedConditions, func(i, j int) bool {
+ iValue := 1
+ jValue := 1
+ if sortedConditions[i].Variant != nil {
+ iValue = -1
+ }
+
+ if sortedConditions[j].Variant != nil {
+ jValue = -1
+ }
+
+ return iValue < jValue
+ })
+
+ for _, condition := range sortedConditions {
+
+ isMatch, err := isConditionMatch(flag, distinctId, condition, properties, cohorts)
+ if err != nil {
+ if _, ok := err.(*InconclusiveMatchError); ok {
+ isInconclusive = true
+ } else {
+ return nil, err
+ }
+ }
+
+ if isMatch {
+ variantOverride := condition.Variant
+ multivariates := flag.Filters.Multivariate
+
+ if variantOverride != nil && multivariates != nil && multivariates.Variants != nil && containsVariant(multivariates.Variants, *variantOverride) {
+ return *variantOverride, nil
+ } else {
+ return getMatchingVariant(flag, distinctId)
+ }
+ }
+ }
+
+ if isInconclusive {
+ return false, &InconclusiveMatchError{"Can't determine if feature flag is enabled or not with given properties"}
+ }
+
+ return false, nil
+}
+
+func isConditionMatch(
+ flag FeatureFlag,
+ distinctId string,
+ condition FeatureFlagCondition,
+ properties Properties,
+ cohorts map[string]PropertyGroup,
+) (bool, error) {
+ if len(condition.Properties) > 0 {
+ for _, prop := range condition.Properties {
+ var isMatch bool
+ var err error
+
+ if prop.Type == "cohort" {
+ isMatch, err = matchCohort(prop, properties, cohorts)
+ } else {
+ isMatch, err = matchProperty(prop, properties)
+ }
+
+ if err != nil {
+ return false, err
+ }
+
+ if !isMatch {
+ return false, nil
+ }
+ }
+
+ if condition.RolloutPercentage != nil {
+ return true, nil
+ }
+ }
+
+ if condition.RolloutPercentage != nil {
+ return checkIfSimpleFlagEnabled(flag.Key, distinctId, *condition.RolloutPercentage)
+ }
+
+ return true, nil
+}
+
+func matchCohort(property FlagProperty, properties Properties, cohorts map[string]PropertyGroup) (bool, error) {
+ cohortId := fmt.Sprint(property.Value)
+ propertyGroup, ok := cohorts[cohortId]
+ if !ok {
+ return false, fmt.Errorf("can't match cohort: cohort %s not found", cohortId)
+ }
+
+ return matchPropertyGroup(propertyGroup, properties, cohorts)
+}
+
+func matchPropertyGroup(propertyGroup PropertyGroup, properties Properties, cohorts map[string]PropertyGroup) (bool, error) {
+ groupType := propertyGroup.Type
+ values := propertyGroup.Values
+
+ if len(values) == 0 {
+ // empty groups are no-ops, always match
+ return true, nil
+ }
+
+ errorMatchingLocally := false
+
+ for _, value := range values {
+ switch prop := value.(type) {
+ case map[string]any:
+ if _, ok := prop["values"]; ok {
+ // PropertyGroup
+ matches, err := matchPropertyGroup(PropertyGroup{
+ Type: getSafeProp[string](prop, "type"),
+ Values: getSafeProp[[]any](prop, "values"),
+ }, properties, cohorts)
+ if err != nil {
+ if _, ok := err.(*InconclusiveMatchError); ok {
+ errorMatchingLocally = true
+ } else {
+ return false, err
+ }
+ }
+
+ if groupType == "AND" {
+ if !matches {
+ return false, nil
+ }
+ } else {
+ // OR group
+ if matches {
+ return true, nil
+ }
+ }
+ } else {
+ // FlagProperty
+ var matches bool
+ var err error
+ flagProperty := FlagProperty{
+ Key: getSafeProp[string](prop, "key"),
+ Operator: getSafeProp[string](prop, "operator"),
+ Value: getSafeProp[any](prop, "value"),
+ Type: getSafeProp[string](prop, "type"),
+ Negation: getSafeProp[bool](prop, "negation"),
+ }
+ if prop["type"] == "cohort" {
+ matches, err = matchCohort(flagProperty, properties, cohorts)
+ } else {
+ matches, err = matchProperty(flagProperty, properties)
+ }
+
+ if err != nil {
+ if _, ok := err.(*InconclusiveMatchError); ok {
+ errorMatchingLocally = true
+ } else {
+ return false, err
+ }
+ }
+
+ negation := flagProperty.Negation
+ if groupType == "AND" {
+ // if negated property, do the inverse
+ if !matches && !negation {
+ return false, nil
+ }
+ if matches && negation {
+ return false, nil
+ }
+ } else {
+ // OR group
+ if matches && !negation {
+ return true, nil
+ }
+ if !matches && negation {
+ return true, nil
+ }
+ }
+ }
+ }
+ }
+
+ if errorMatchingLocally {
+ return false, &InconclusiveMatchError{msg: "Can't match cohort without a given cohort property value"}
+ }
+
+ // if we get here, all matched in AND case, or none matched in OR case
+ return groupType == "AND", nil
+}
+
+func matchProperty(property FlagProperty, properties Properties) (bool, error) {
+ key := property.Key
+ operator := property.Operator
+ value := property.Value
+ if _, ok := properties[key]; !ok {
+ return false, &InconclusiveMatchError{"Can't match properties without a given property value"}
+ }
+
+ if operator == "is_not_set" {
+ return false, &InconclusiveMatchError{"Can't match properties with operator is_not_set"}
+ }
+
+ override_value := properties[key]
+
+ if operator == "exact" {
+ switch t := value.(type) {
+ case []interface{}:
+ return contains(t, override_value), nil
+ default:
+ return value == override_value, nil
+ }
+ }
+
+ if operator == "is_not" {
+ switch t := value.(type) {
+ case []interface{}:
+ return !contains(t, override_value), nil
+ default:
+ return value != override_value, nil
+ }
+ }
+
+ if operator == "is_set" {
+ return true, nil
+ }
+
+ if operator == "icontains" {
+ return strings.Contains(strings.ToLower(fmt.Sprintf("%v", override_value)), strings.ToLower(fmt.Sprintf("%v", value))), nil
+ }
+
+ if operator == "not_icontains" {
+ return !strings.Contains(strings.ToLower(fmt.Sprintf("%v", override_value)), strings.ToLower(fmt.Sprintf("%v", value))), nil
+ }
+
+ if operator == "regex" {
+
+ r, err := regexp.Compile(fmt.Sprintf("%v", value))
+ // invalid regex
+ if err != nil {
+ return false, nil
+ }
+
+ match := r.MatchString(fmt.Sprintf("%v", override_value))
+
+ if match {
+ return true, nil
+ } else {
+ return false, nil
+ }
+ }
+
+ if operator == "not_regex" {
+ var r *regexp.Regexp
var err error
- isFlagEnabledResponse, err = poller.isSimpleFlagEnabled(key, distinctId, rolloutPercentage)
+
+ if valueString, ok := value.(string); ok {
+ r, err = regexp.Compile(valueString)
+ } else if valueInt, ok := value.(int); ok {
+ valueString = strconv.Itoa(valueInt)
+ r, err = regexp.Compile(valueString)
+ } else {
+ errMessage := "regex expression not allowed"
+ return false, errors.New(errMessage)
+ }
+
+ // invalid regex
if err != nil {
- return false, err
+ return false, nil
}
- } else {
- requestDataBytes, err := json.Marshal(DecideRequestData{
- ApiKey: poller.projectApiKey,
- DistinctId: distinctId,
- })
+
+ var match bool
+ if valueString, ok := override_value.(string); ok {
+ match = r.MatchString(valueString)
+ } else if valueInt, ok := override_value.(int); ok {
+ valueString = strconv.Itoa(valueInt)
+ match = r.MatchString(valueString)
+ } else {
+ errMessage := "value type not supported"
+ return false, errors.New(errMessage)
+ }
+
+ if !match {
+ return true, nil
+ } else {
+ return false, nil
+ }
+ }
+
+ if operator == "gt" {
+ valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value)
if err != nil {
- errorMessage = "unable to marshal decide endpoint request data"
- poller.Errorf(errorMessage)
- return false, errors.New(errorMessage)
+ return false, err
}
- res, err := poller.request("POST", "decide", requestDataBytes, [][2]string{})
- if err != nil || res.StatusCode != http.StatusOK {
- errorMessage = "Error calling /decide/"
- poller.Errorf(errorMessage)
- return false, errors.New(errorMessage)
+
+ return overrideValueOrderable > valueOrderable, nil
+ }
+
+ if operator == "lt" {
+ valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value)
+ if err != nil {
+ return false, err
}
- resBody, err := ioutil.ReadAll(res.Body)
+
+ return overrideValueOrderable < valueOrderable, nil
+ }
+
+ if operator == "gte" {
+ valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value)
if err != nil {
- errorMessage = "Error reading response from /decide/"
- poller.Errorf(errorMessage)
- return false, errors.New(errorMessage)
+ return false, err
}
- defer res.Body.Close()
- decideResponse := DecideResponse{}
- err = json.Unmarshal([]byte(resBody), &decideResponse)
+
+ return overrideValueOrderable >= valueOrderable, nil
+ }
+
+ if operator == "lte" {
+ valueOrderable, overrideValueOrderable, err := validateOrderable(value, override_value)
if err != nil {
- errorMessage = "Error parsing response from /decide/"
- poller.Errorf(errorMessage)
- return false, errors.New(errorMessage)
+ return false, err
}
- for _, enabledFlag := range decideResponse.FeatureFlags {
- if key == enabledFlag {
- isFlagEnabledResponse = true
- }
+
+ return overrideValueOrderable <= valueOrderable, nil
+ }
+
+ return false, &InconclusiveMatchError{"Unknown operator: " + operator}
+
+}
+
+func validateOrderable(firstValue interface{}, secondValue interface{}) (float64, float64, error) {
+ convertedFirstValue, err := interfaceToFloat(firstValue)
+ if err != nil {
+ errMessage := "value 1 is not orderable"
+ return 0, 0, errors.New(errMessage)
+ }
+ convertedSecondValue, err := interfaceToFloat(secondValue)
+ if err != nil {
+ errMessage := "value 2 is not orderable"
+ return 0, 0, errors.New(errMessage)
+ }
+
+ return convertedFirstValue, convertedSecondValue, nil
+}
+
+func interfaceToFloat(val interface{}) (float64, error) {
+ var i float64
+ switch t := val.(type) {
+ case int:
+ i = float64(t)
+ case int8:
+ i = float64(t)
+ case int16:
+ i = float64(t)
+ case int32:
+ i = float64(t)
+ case int64:
+ i = float64(t)
+ case float32:
+ i = float64(t)
+ case float64:
+ i = float64(t)
+ case uint8:
+ i = float64(t)
+ case uint16:
+ i = float64(t)
+ case uint32:
+ i = float64(t)
+ case uint64:
+ i = float64(t)
+ default:
+ errMessage := "argument not orderable"
+ return 0.0, errors.New(errMessage)
+ }
+
+ return i, nil
+}
+
+func contains(s []interface{}, e interface{}) bool {
+ for _, a := range s {
+ if a == e {
+ return true
}
}
+ return false
+}
- return isFlagEnabledResponse, nil
+func containsVariant(variantList []FlagVariant, key string) bool {
+ for _, variant := range variantList {
+ if variant.Key == key {
+ return true
+ }
+ }
+ return false
}
func (poller *FeatureFlagsPoller) isSimpleFlagEnabled(key string, distinctId string, rolloutPercentage uint8) (bool, error) {
@@ -208,42 +846,76 @@ func (poller *FeatureFlagsPoller) isSimpleFlagEnabled(key string, distinctId str
// extracted as a regular func for testing purposes
func checkIfSimpleFlagEnabled(key string, distinctId string, rolloutPercentage uint8) (bool, error) {
+ val, err := _hash(key, distinctId, "")
+ if err != nil {
+ return false, err
+ }
+
+ return val <= float64(rolloutPercentage)/100, nil
+}
+
+func _hash(key string, distinctId string, salt string) (float64, error) {
hash := sha1.New()
- hash.Write([]byte("" + key + "." + distinctId + ""))
+ hash.Write([]byte("" + key + "." + distinctId + "" + salt))
digest := hash.Sum(nil)
hexString := fmt.Sprintf("%x\n", digest)[:15]
value, err := strconv.ParseInt(hexString, 16, 64)
if err != nil {
- return false, err
+ return 0, err
+ }
+
+ return float64(value) / LONG_SCALE, nil
+}
+
+func (poller *FeatureFlagsPoller) GetFeatureFlags() ([]FeatureFlag, error) {
+ // When channel is open this will block. When channel is closed it will immediately exit.
+ _, closed := <-poller.loaded
+ if closed && poller.featureFlags == nil {
+ // There was an error with initial flag fetching
+ return nil, fmt.Errorf("flags were not successfully fetched yet")
}
- return (float64(value) / LONG_SCALE) <= float64(rolloutPercentage)/100, nil
+
+ return poller.featureFlags, nil
}
-func (poller *FeatureFlagsPoller) GetFeatureFlags() []FeatureFlag {
- // ensure flags are loaded on the first call
- if !poller.fetchedFlagsSuccessfullyOnce {
- <-poller.loaded
+func (poller *FeatureFlagsPoller) decide(requestData []byte, headers [][2]string) (*http.Response, context.CancelFunc, error) {
+ decideEndpoint := "decide/?v=3"
+
+ url, err := url.Parse(poller.Endpoint + "/" + decideEndpoint + "")
+ if err != nil {
+ poller.Errorf("creating url - %s", err)
}
- poller.mutex.RLock()
+ return poller.request("POST", url, requestData, headers, poller.flagTimeout)
+}
+
+func (poller *FeatureFlagsPoller) localEvaluationFlags(headers [][2]string) (*http.Response, context.CancelFunc, error) {
+ localEvaluationEndpoint := "api/feature_flag/local_evaluation"
- defer poller.mutex.RUnlock()
+ url, err := url.Parse(poller.Endpoint + "/" + localEvaluationEndpoint + "")
+ if err != nil {
+ poller.Errorf("creating url - %s", err)
+ }
+ searchParams := url.Query()
+ searchParams.Add("token", poller.projectApiKey)
+ searchParams.Add("send_cohorts", "true")
+ url.RawQuery = searchParams.Encode()
- return poller.featureFlags
+ return poller.request("GET", url, []byte{}, headers, time.Duration(10)*time.Second)
}
-func (poller *FeatureFlagsPoller) request(method string, endpoint string, requestData []byte, headers [][2]string) (*http.Response, error) {
+func (poller *FeatureFlagsPoller) request(method string, url *url.URL, requestData []byte, headers [][2]string, timeout time.Duration) (*http.Response, context.CancelFunc, error) {
+ ctx, cancel := context.WithTimeout(context.Background(), timeout)
- url := poller.Endpoint + "/" + endpoint + "/"
- req, err := http.NewRequest(method, url, bytes.NewReader(requestData))
+ req, err := http.NewRequestWithContext(ctx, method, url.String(), bytes.NewReader(requestData))
if err != nil {
poller.Errorf("creating request - %s", err)
}
version := getVersion()
- req.Header.Add("User-Agent", "posthog-go (version: "+version+")")
+ req.Header.Add("User-Agent", SdkName+"/"+version)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Content-Length", fmt.Sprintf("%d", len(requestData)))
@@ -252,12 +924,11 @@ func (poller *FeatureFlagsPoller) request(method string, endpoint string, reques
}
res, err := poller.http.Do(req)
-
if err != nil {
poller.Errorf("sending request - %s", err)
}
- return res, err
+ return res, cancel, err
}
func (poller *FeatureFlagsPoller) ForceReload() {
@@ -267,3 +938,103 @@ func (poller *FeatureFlagsPoller) ForceReload() {
func (poller *FeatureFlagsPoller) shutdownPoller() {
poller.shutdown <- true
}
+
+func (poller *FeatureFlagsPoller) getFeatureFlagVariants(distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (*DecideResponse, error) {
+ errorMessage := "Failed when getting flag variants"
+ requestDataBytes, err := json.Marshal(DecideRequestData{
+ ApiKey: poller.projectApiKey,
+ DistinctId: distinctId,
+ Groups: groups,
+ PersonProperties: personProperties,
+ GroupProperties: groupProperties,
+ })
+ headers := [][2]string{{"Authorization", "Bearer " + poller.personalApiKey + ""}}
+ if err != nil {
+ errorMessage = "unable to marshal decide endpoint request data"
+ poller.Errorf(errorMessage)
+ return nil, errors.New(errorMessage)
+ }
+ res, cancel, err := poller.decide(requestDataBytes, headers)
+ defer cancel()
+ if err != nil || res.StatusCode != http.StatusOK {
+ errorMessage = "Error calling /decide/"
+ if err != nil {
+ errorMessage += " - " + err.Error()
+ }
+ poller.Errorf(errorMessage)
+ return nil, errors.New(errorMessage)
+ }
+ resBody, err := ioutil.ReadAll(res.Body)
+ if err != nil {
+ errorMessage = "Error reading response from /decide/"
+ poller.Errorf(errorMessage)
+ return nil, errors.New(errorMessage)
+ }
+ defer res.Body.Close()
+ decideResponse := DecideResponse{}
+ err = json.Unmarshal([]byte(resBody), &decideResponse)
+ if err != nil {
+ errorMessage = "Error parsing response from /decide/"
+ poller.Errorf(errorMessage)
+ return nil, errors.New(errorMessage)
+ }
+
+ return &decideResponse, nil
+}
+
+func (poller *FeatureFlagsPoller) getFeatureFlagVariant(featureFlag FeatureFlag, key string, distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (interface{}, error) {
+ var result interface{} = false
+
+ if featureFlag.IsSimpleFlag {
+
+ // json.Unmarshal will convert JSON `null` to a nullish value for each type
+ // which is 0 for uint. However, our feature flags should have rolloutPercentage == 100
+ // if it is set to `null`. Having rollout percentage be a pointer and deferencing it
+ // here allows its value to be `nil` following json.Unmarhsal, so we can appropriately
+ // set it to 100
+ rolloutPercentage := uint8(100)
+ if featureFlag.RolloutPercentage != nil {
+ rolloutPercentage = *featureFlag.RolloutPercentage
+ }
+ var err error
+ result, err = poller.isSimpleFlagEnabled(key, distinctId, rolloutPercentage)
+ if err != nil {
+ return false, err
+ }
+ } else {
+ featureFlagVariants, variantErr := poller.getFeatureFlagVariants(distinctId, groups, personProperties, groupProperties)
+
+ if variantErr != nil {
+ return false, variantErr
+ }
+
+ for flagKey, flagValue := range featureFlagVariants.FeatureFlags {
+ flagValueString := fmt.Sprintf("%v", flagValue)
+ if key == flagKey && flagValueString != "false" {
+ result = flagValueString
+ break
+ }
+ }
+ return result, nil
+ }
+ return result, nil
+}
+
+func (poller *FeatureFlagsPoller) getFeatureFlagPayload(key string, distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (string, error) {
+ featureFlagVariants, err := poller.getFeatureFlagVariants(distinctId, groups, personProperties, groupProperties)
+ if err != nil {
+ return "", err
+ }
+
+ return featureFlagVariants.FeatureFlagPayloads[key], nil
+}
+
+func getSafeProp[T any](properties map[string]any, key string) T {
+ switch v := properties[key].(type) {
+ case T:
+ return v
+ default:
+ var defaultValue T
+ return defaultValue
+ }
+}
diff --git a/vendor/github.com/posthog/posthog-go/group_identify.go b/vendor/github.com/posthog/posthog-go/group_identify.go
new file mode 100644
index 0000000000..52cc210a8e
--- /dev/null
+++ b/vendor/github.com/posthog/posthog-go/group_identify.go
@@ -0,0 +1,69 @@
+package posthog
+
+import (
+ "fmt"
+ "time"
+)
+
+type GroupIdentify struct {
+ Type string
+ Key string
+
+ DistinctId string
+ Timestamp time.Time
+ Properties Properties
+}
+
+func (msg GroupIdentify) internal() {
+ panic(unimplementedError)
+}
+
+func (msg GroupIdentify) Validate() error {
+ if len(msg.Type) == 0 {
+ return FieldError{
+ Type: "posthog.GroupIdentify",
+ Name: "Type",
+ Value: msg.Type,
+ }
+ }
+
+ if len(msg.Key) == 0 {
+ return FieldError{
+ Type: "posthog.GroupIdentify",
+ Name: "Key",
+ Value: msg.Key,
+ }
+ }
+
+ return nil
+}
+
+type GroupIdentifyInApi struct {
+ Library string `json:"library"`
+ LibraryVersion string `json:"library_version"`
+ Timestamp time.Time `json:"timestamp"`
+
+ Event string `json:"event"`
+ DistinctId string `json:"distinct_id"`
+ Properties Properties `json:"properties"`
+}
+
+func (msg GroupIdentify) APIfy() APIMessage {
+ library := "posthog-go"
+
+ myProperties := Properties{}.Set("$lib", library).Set("$lib_version", getVersion())
+ myProperties.Set("$group_type", msg.Type).Set("$group_key", msg.Key).Set("$group_set", msg.Properties)
+
+ distinctId := fmt.Sprintf("$%s_%s", msg.Type, msg.Key)
+
+ apified := GroupIdentifyInApi{
+ Event: "$groupidentify",
+ Properties: myProperties,
+ DistinctId: distinctId,
+ Timestamp: msg.Timestamp,
+ Library: library,
+ LibraryVersion: getVersion(),
+ }
+
+ return apified
+}
diff --git a/vendor/github.com/posthog/posthog-go/groups.go b/vendor/github.com/posthog/posthog-go/groups.go
new file mode 100644
index 0000000000..3ec6e47f57
--- /dev/null
+++ b/vendor/github.com/posthog/posthog-go/groups.go
@@ -0,0 +1,17 @@
+package posthog
+
+// This type is used to represent groups in messages that support it.
+// It is a free-form object so the application can set any value it sees fit but
+// a few helper method are defined to make it easier to instantiate groups with
+// common fields.
+
+type Groups map[string]interface{}
+
+func NewGroups() Groups {
+ return make(Groups, 10)
+}
+
+func (p Groups) Set(name string, value interface{}) Groups {
+ p[name] = value
+ return p
+}
diff --git a/vendor/github.com/posthog/posthog-go/message.go b/vendor/github.com/posthog/posthog-go/message.go
index 2edd4edc0e..7536074bde 100644
--- a/vendor/github.com/posthog/posthog-go/message.go
+++ b/vendor/github.com/posthog/posthog-go/message.go
@@ -55,8 +55,9 @@ func makeTimestamp(t time.Time, def time.Time) time.Time {
// export this type because it's only meant to be used internally to send groups
// of messages in one API call.
type batch struct {
- ApiKey string `json:"api_key"`
- Messages []message `json:"batch"`
+ ApiKey string `json:"api_key"`
+ HistoricalMigration bool `json:"historical_migration,omitempty"`
+ Messages []message `json:"batch"`
}
type APIMessage interface{}
@@ -119,5 +120,5 @@ func (q *messageQueue) flush() (msgs []message) {
const (
maxBatchBytes = 500000
- maxMessageBytes = 32000
+ maxMessageBytes = 500000
)
diff --git a/vendor/github.com/posthog/posthog-go/posthog.go b/vendor/github.com/posthog/posthog-go/posthog.go
index f4a0c6feee..5502f706ea 100644
--- a/vendor/github.com/posthog/posthog-go/posthog.go
+++ b/vendor/github.com/posthog/posthog-go/posthog.go
@@ -8,11 +8,13 @@ import (
"io"
"io/ioutil"
"net/http"
+ "net/url"
"sync"
"time"
)
const unimplementedError = "not implemented"
+const SIZE_DEFAULT = 50_000
// This interface is the main API exposed by the posthog package.
// Values that satsify this interface are returned by the client constructors
@@ -37,13 +39,31 @@ type Client interface {
Enqueue(Message) error
//
// Method returns if a feature flag is on for a given user based on their distinct ID
- IsFeatureEnabled(string, string, bool) (bool, error)
+ IsFeatureEnabled(FeatureFlagPayload) (interface{}, error)
+ //
+ // Method returns variant value if multivariantflag or otherwise a boolean indicating
+ // if the given flag is on or off for the user
+ GetFeatureFlag(FeatureFlagPayload) (interface{}, error)
+ //
+ // Method returns feature flag payload value matching key for user (supports multivariate flags).
+ GetFeatureFlagPayload(FeatureFlagPayload) (string, error)
+ //
+ // Method returns decrypted feature flag payload value for remote config flags.
+ GetRemoteConfigPayload(string) (string, error)
+ //
+ // Get all flags - returns all flags for a user
+ GetAllFlags(FeatureFlagPayloadNoKey) (map[string]interface{}, error)
//
// Method forces a reload of feature flags
+ // NB: This is only available when using a PersonalApiKey
ReloadFeatureFlags() error
//
// Get feature flags - for testing only
+ // NB: This is only available when using a PersonalApiKey
GetFeatureFlags() ([]FeatureFlag, error)
+ //
+ // Get the last captured event
+ GetLastCapturedEvent() *Capture
}
type client struct {
@@ -69,6 +89,13 @@ type client struct {
// A background poller for fetching feature flags
featureFlagsPoller *FeatureFlagsPoller
+
+ distinctIdsFeatureFlagsReported *SizeLimitedMap
+
+ // Last captured event
+ lastCapturedEvent *Capture
+ // Mutex to protect last captured event
+ lastEventMutex sync.RWMutex
}
// Instantiate a new client that uses the write key passed as first argument to
@@ -91,16 +118,26 @@ func NewWithConfig(apiKey string, config Config) (cli Client, err error) {
}
c := &client{
- Config: makeConfig(config),
- key: apiKey,
- msgs: make(chan APIMessage, 100),
- quit: make(chan struct{}),
- shutdown: make(chan struct{}),
- http: makeHttpClient(config.Transport),
+ Config: makeConfig(config),
+ key: apiKey,
+ msgs: make(chan APIMessage, 100),
+ quit: make(chan struct{}),
+ shutdown: make(chan struct{}),
+ http: makeHttpClient(config.Transport),
+ distinctIdsFeatureFlagsReported: newSizeLimitedMap(SIZE_DEFAULT),
}
if len(c.PersonalApiKey) > 0 {
- c.featureFlagsPoller = newFeatureFlagsPoller(c.key, c.Config.PersonalApiKey, c.Errorf, c.Endpoint, c.http, c.DefaultFeatureFlagsPollingInterval)
+ c.featureFlagsPoller = newFeatureFlagsPoller(
+ c.key,
+ c.Config.PersonalApiKey,
+ c.Errorf,
+ c.Endpoint,
+ c.http,
+ c.DefaultFeatureFlagsPollingInterval,
+ c.NextFeatureFlagsPollingTick,
+ c.FeatureFlagRequestTimeout,
+ )
}
go c.loop()
@@ -131,6 +168,11 @@ func dereferenceMessage(msg Message) Message {
return nil
}
return *m
+ case *GroupIdentify:
+ if m == nil {
+ return nil
+ }
+ return *m
case *Capture:
if m == nil {
return nil
@@ -160,9 +202,42 @@ func (c *client) Enqueue(msg Message) (err error) {
m.Timestamp = makeTimestamp(m.Timestamp, ts)
msg = m
+ case GroupIdentify:
+ m.Timestamp = makeTimestamp(m.Timestamp, ts)
+ msg = m
+
case Capture:
m.Type = "capture"
m.Timestamp = makeTimestamp(m.Timestamp, ts)
+ if m.SendFeatureFlags {
+ // Add all feature variants to event
+ featureVariants, err := c.getFeatureVariants(m.DistinctId, m.Groups, NewProperties(), map[string]Properties{})
+ if err != nil {
+ c.Errorf("unable to get feature variants - %s", err)
+ }
+
+ if m.Properties == nil {
+ m.Properties = NewProperties()
+ }
+
+ for feature, variant := range featureVariants {
+ propKey := fmt.Sprintf("$feature/%s", feature)
+ m.Properties[propKey] = variant
+ }
+ // Add all feature flag keys to $active_feature_flags key
+ featureKeys := make([]string, len(featureVariants))
+ i := 0
+ for k := range featureVariants {
+ featureKeys[i] = k
+ i++
+ }
+ m.Properties["$active_feature_flags"] = featureKeys
+ }
+ if m.Properties == nil {
+ m.Properties = NewProperties()
+ }
+ m.Properties.Merge(c.DefaultEventProperties)
+ c.setLastCapturedEvent(m)
msg = m
default:
@@ -181,25 +256,44 @@ func (c *client) Enqueue(msg Message) (err error) {
}()
c.msgs <- msg.APIfy()
+
return
}
-func (c *client) IsFeatureEnabled(flagKey string, distinctId string, defaultValue bool) (bool, error) {
- if c.featureFlagsPoller == nil {
- errorMessage := "specifying a PersonalApiKey is required for using feature flags"
- c.Errorf(errorMessage)
- return false, errors.New(errorMessage)
- }
- isEnabled, err := c.featureFlagsPoller.IsFeatureEnabled(flagKey, distinctId, defaultValue)
- c.Enqueue(Capture{
- DistinctId: distinctId,
- Event: "$feature_flag_called",
- Properties: NewProperties().
- Set("$feature_flag", flagKey).
- Set("$feature_flag_response", isEnabled).
- Set("$feature_flag_errored", err != nil),
- })
- return isEnabled, err
+func (c *client) setLastCapturedEvent(event Capture) {
+ c.lastEventMutex.Lock()
+ defer c.lastEventMutex.Unlock()
+ c.lastCapturedEvent = &event
+}
+
+func (c *client) GetLastCapturedEvent() *Capture {
+ c.lastEventMutex.RLock()
+ defer c.lastEventMutex.RUnlock()
+ if c.lastCapturedEvent == nil {
+ return nil
+ }
+ // Return a copy to avoid data races
+ eventCopy := *c.lastCapturedEvent
+ return &eventCopy
+}
+
+func (c *client) IsFeatureEnabled(flagConfig FeatureFlagPayload) (interface{}, error) {
+ if err := flagConfig.validate(); err != nil {
+ return false, err
+ }
+
+ result, err := c.GetFeatureFlag(flagConfig)
+ if err != nil {
+ return nil, err
+ }
+
+ if result == "false" {
+ result = false
+ } else if result == "true" {
+ result = true
+ }
+
+ return result, nil
}
func (c *client) ReloadFeatureFlags() error {
@@ -212,13 +306,94 @@ func (c *client) ReloadFeatureFlags() error {
return nil
}
+func (c *client) GetFeatureFlagPayload(flagConfig FeatureFlagPayload) (string, error) {
+ if err := flagConfig.validate(); err != nil {
+ return "", err
+ }
+
+ var payload string
+ var err error
+
+ if c.featureFlagsPoller != nil {
+ // get feature flag from the poller, which uses the personal api key
+ // this is only available when using a PersonalApiKey
+ payload, err = c.featureFlagsPoller.GetFeatureFlagPayload(flagConfig)
+ } else {
+ // if there's no poller, get the feature flag from the decide endpoint
+ c.debugf("getting feature flag from decide endpoint")
+ payload, err = c.getFeatureFlagPayloadFromDecide(flagConfig.Key, flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties)
+ }
+
+ return payload, err
+}
+
+func (c *client) GetFeatureFlag(flagConfig FeatureFlagPayload) (interface{}, error) {
+ if err := flagConfig.validate(); err != nil {
+ return false, err
+ }
+
+ var flagValue interface{}
+ var err error
+
+ if c.featureFlagsPoller != nil {
+ // get feature flag from the poller, which uses the personal api key
+ // this is only available when using a PersonalApiKey
+ flagValue, err = c.featureFlagsPoller.GetFeatureFlag(flagConfig)
+ } else {
+ // if there's no poller, get the feature flag from the decide endpoint
+ c.debugf("getting feature flag from decide endpoint")
+ flagValue, err = c.getFeatureFlagFromDecide(flagConfig.Key, flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties)
+ }
+
+ if *flagConfig.SendFeatureFlagEvents && !c.distinctIdsFeatureFlagsReported.contains(flagConfig.DistinctId, flagConfig.Key) {
+ c.Enqueue(Capture{
+ DistinctId: flagConfig.DistinctId,
+ Event: "$feature_flag_called",
+ Properties: NewProperties().
+ Set("$feature_flag", flagConfig.Key).
+ Set("$feature_flag_response", flagValue).
+ Set("$feature_flag_errored", err != nil),
+ Groups: flagConfig.Groups,
+ })
+ c.distinctIdsFeatureFlagsReported.add(flagConfig.DistinctId, flagConfig.Key)
+ }
+
+ return flagValue, err
+}
+
+func (c *client) GetRemoteConfigPayload(flagKey string) (string, error) {
+ return c.makeRemoteConfigRequest(flagKey)
+}
+
func (c *client) GetFeatureFlags() ([]FeatureFlag, error) {
if c.featureFlagsPoller == nil {
errorMessage := "specifying a PersonalApiKey is required for using feature flags"
c.Errorf(errorMessage)
return nil, errors.New(errorMessage)
}
- return c.featureFlagsPoller.GetFeatureFlags(), nil
+ return c.featureFlagsPoller.GetFeatureFlags()
+}
+
+func (c *client) GetAllFlags(flagConfig FeatureFlagPayloadNoKey) (map[string]interface{}, error) {
+
+ if err := flagConfig.validate(); err != nil {
+ return nil, err
+ }
+
+ var flagsValue map[string]interface{}
+ var err error
+
+ if c.featureFlagsPoller != nil {
+ // get feature flags from the poller, which uses the personal api key
+ // this is only available when using a PersonalApiKey
+ flagsValue, err = c.featureFlagsPoller.GetAllFlags(flagConfig)
+ } else {
+ // if there's no poller, get the feature flags from the decide endpoint
+ c.debugf("getting all feature flags from decide endpoint")
+ flagsValue, err = c.getAllFeatureFlagsFromDecide(flagConfig.DistinctId, flagConfig.Groups, flagConfig.PersonProperties, flagConfig.GroupProperties)
+ }
+
+ return flagsValue, err
}
// Close and flush metrics.
@@ -235,7 +410,7 @@ func (c *client) Close() (err error) {
return
}
-// Asychronously send a batched requests.
+// Asynchronously send a batched requests.
func (c *client) sendAsync(msgs []message, wg *sync.WaitGroup, ex *executor) {
wg.Add(1)
@@ -262,8 +437,9 @@ func (c *client) send(msgs []message) {
const attempts = 10
b, err := json.Marshal(batch{
- ApiKey: c.key,
- Messages: msgs,
+ ApiKey: c.key,
+ HistoricalMigration: c.HistoricalMigration,
+ Messages: msgs,
})
if err != nil {
@@ -303,7 +479,7 @@ func (c *client) upload(b []byte) error {
version := getVersion()
- req.Header.Add("User-Agent", "posthog-go (version: "+version+")")
+ req.Header.Add("User-Agent", SdkName+"/"+version)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Content-Length", fmt.Sprintf("%d", len(b)))
@@ -443,3 +619,167 @@ func (c *client) notifyFailure(msgs []message, err error) {
}
}
}
+
+func (c *client) getFeatureVariants(distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (map[string]interface{}, error) {
+ if c.featureFlagsPoller == nil {
+ errorMessage := "specifying a PersonalApiKey is required for using feature flags"
+ c.Errorf(errorMessage)
+ return nil, errors.New(errorMessage)
+ }
+
+ featureVariants, err := c.featureFlagsPoller.getFeatureFlagVariants(distinctId, groups, personProperties, groupProperties)
+ if err != nil {
+ return nil, err
+ }
+ return featureVariants.FeatureFlags, nil
+}
+
+func (c *client) makeDecideRequest(distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (*DecideResponse, error) {
+ requestData := DecideRequestData{
+ ApiKey: c.key,
+ DistinctId: distinctId,
+ Groups: groups,
+ PersonProperties: personProperties,
+ GroupProperties: groupProperties,
+ }
+
+ requestDataBytes, err := json.Marshal(requestData)
+ if err != nil {
+ return nil, fmt.Errorf("unable to marshal decide endpoint request data: %v", err)
+ }
+
+ decideEndpoint := "decide/?v=3"
+ url, err := url.Parse(c.Endpoint + "/" + decideEndpoint)
+ if err != nil {
+ return nil, fmt.Errorf("creating url: %v", err)
+ }
+
+ req, err := http.NewRequest("POST", url.String(), bytes.NewReader(requestDataBytes))
+ if err != nil {
+ return nil, fmt.Errorf("creating request: %v", err)
+ }
+
+ req.Header.Set("Content-Type", "application/json")
+ req.Header.Set("User-Agent", "posthog-go/"+Version)
+
+ res, err := c.http.Do(req)
+ if err != nil {
+ return nil, fmt.Errorf("sending request: %v", err)
+ }
+ defer res.Body.Close()
+
+ if res.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("unexpected status code from /decide/: %d", res.StatusCode)
+ }
+
+ resBody, err := ioutil.ReadAll(res.Body)
+ if err != nil {
+ return nil, fmt.Errorf("error reading response from /decide/: %v", err)
+ }
+
+ var decideResponse DecideResponse
+ err = json.Unmarshal(resBody, &decideResponse)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing response from /decide/: %v", err)
+ }
+
+ return &decideResponse, nil
+}
+
+func (c *client) makeRemoteConfigRequest(flagKey string) (string, error) {
+ remoteConfigEndpoint := fmt.Sprintf("api/projects/@current/feature_flags/%s/remote_config/", flagKey)
+ url, err := url.Parse(c.Endpoint + "/" + remoteConfigEndpoint)
+ if err != nil {
+ return "", fmt.Errorf("creating url: %v", err)
+ }
+
+ req, err := http.NewRequest("GET", url.String(), nil)
+ if err != nil {
+ return "", fmt.Errorf("creating request: %v", err)
+ }
+
+ req.Header.Set("Authorization", "Bearer "+c.PersonalApiKey)
+ req.Header.Set("Content-Type", "application/json")
+ req.Header.Set("User-Agent", "posthog-go/"+Version)
+
+ res, err := c.http.Do(req)
+ if err != nil {
+ return "", fmt.Errorf("sending request: %v", err)
+ }
+ defer res.Body.Close()
+
+ if res.StatusCode != http.StatusOK {
+ return "", fmt.Errorf("unexpected status code from %s: %d", remoteConfigEndpoint, res.StatusCode)
+ }
+
+ resBody, err := io.ReadAll(res.Body)
+ if err != nil {
+ return "", fmt.Errorf("error reading response from /remote_config/: %v", err)
+ }
+
+ var responseData string
+ if err := json.Unmarshal(resBody, &responseData); err != nil {
+ return "", fmt.Errorf("error parsing JSON response from /remote_config/: %v", err)
+ }
+ return responseData, nil
+}
+
+// isFeatureFlagsQuotaLimited checks if feature flags are quota limited in the decide response
+func (c *client) isFeatureFlagsQuotaLimited(decideResponse *DecideResponse) bool {
+ if decideResponse.QuotaLimited != nil {
+ for _, limitedFeature := range *decideResponse.QuotaLimited {
+ if limitedFeature == "feature_flags" {
+ c.Errorf("[FEATURE FLAGS] PostHog feature flags quota limited. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts")
+ return true
+ }
+ }
+ }
+ return false
+}
+
+func (c *client) getFeatureFlagFromDecide(key string, distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (interface{}, error) {
+ decideResponse, err := c.makeDecideRequest(distinctId, groups, personProperties, groupProperties)
+ if err != nil {
+ return nil, err
+ }
+
+ if c.isFeatureFlagsQuotaLimited(decideResponse) {
+ return false, nil
+ }
+
+ if value, ok := decideResponse.FeatureFlags[key]; ok {
+ return value, nil
+ }
+
+ return false, nil
+}
+
+func (c *client) getFeatureFlagPayloadFromDecide(key string, distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (string, error) {
+ decideResponse, err := c.makeDecideRequest(distinctId, groups, personProperties, groupProperties)
+ if err != nil {
+ return "", err
+ }
+
+ if c.isFeatureFlagsQuotaLimited(decideResponse) {
+ return "", nil
+ }
+
+ if value, ok := decideResponse.FeatureFlagPayloads[key]; ok {
+ return value, nil
+ }
+
+ return "", nil
+}
+
+func (c *client) getAllFeatureFlagsFromDecide(distinctId string, groups Groups, personProperties Properties, groupProperties map[string]Properties) (map[string]interface{}, error) {
+ decideResponse, err := c.makeDecideRequest(distinctId, groups, personProperties, groupProperties)
+ if err != nil {
+ return nil, err
+ }
+
+ if c.isFeatureFlagsQuotaLimited(decideResponse) {
+ return map[string]interface{}{}, nil
+ }
+
+ return decideResponse.FeatureFlags, nil
+}
diff --git a/vendor/github.com/posthog/posthog-go/properties.go b/vendor/github.com/posthog/posthog-go/properties.go
index 46205131ac..ed63d12859 100644
--- a/vendor/github.com/posthog/posthog-go/properties.go
+++ b/vendor/github.com/posthog/posthog-go/properties.go
@@ -12,7 +12,6 @@ package posthog
// .Set("revenue", 10.0)
// .Set("currency", "USD"),
// }
-//
type Properties map[string]interface{}
func NewProperties() Properties {
@@ -23,3 +22,17 @@ func (p Properties) Set(name string, value interface{}) Properties {
p[name] = value
return p
}
+
+// Merge adds the properties from the provided `props` into the receiver `p`.
+// If a property in `props` already exists in `p`, its value will be overwritten.
+func (p Properties) Merge(props Properties) Properties {
+ if props == nil {
+ return p
+ }
+
+ for k, v := range props {
+ p[k] = v
+ }
+
+ return p
+}
diff --git a/vendor/github.com/posthog/posthog-go/timeout_15.go b/vendor/github.com/posthog/posthog-go/timeout_15.go
index 17d882b873..b689d0076d 100644
--- a/vendor/github.com/posthog/posthog-go/timeout_15.go
+++ b/vendor/github.com/posthog/posthog-go/timeout_15.go
@@ -1,3 +1,4 @@
+//go:build !go1.6
// +build !go1.6
package posthog
diff --git a/vendor/github.com/posthog/posthog-go/timeout_16.go b/vendor/github.com/posthog/posthog-go/timeout_16.go
index b5bf68aa84..cc0cc22a5b 100644
--- a/vendor/github.com/posthog/posthog-go/timeout_16.go
+++ b/vendor/github.com/posthog/posthog-go/timeout_16.go
@@ -1,3 +1,4 @@
+//go:build go1.6
// +build go1.6
package posthog
diff --git a/vendor/github.com/posthog/posthog-go/util.go b/vendor/github.com/posthog/posthog-go/util.go
new file mode 100644
index 0000000000..a6264c6a3e
--- /dev/null
+++ b/vendor/github.com/posthog/posthog-go/util.go
@@ -0,0 +1,44 @@
+package posthog
+
+type SizeLimitedMap struct {
+ ids map[string][]string
+ size int
+}
+
+func newSizeLimitedMap(size int) *SizeLimitedMap {
+ newMap := SizeLimitedMap{
+ ids: map[string][]string{},
+ size: size,
+ }
+
+ return &newMap
+}
+
+func (sizeLimitedMap *SizeLimitedMap) add(key string, element string) {
+
+ if len(sizeLimitedMap.ids) >= sizeLimitedMap.size {
+ sizeLimitedMap.ids = map[string][]string{}
+ }
+
+ if val, ok := sizeLimitedMap.ids[key]; ok {
+ sizeLimitedMap.ids[key] = append(val, element)
+ } else {
+ sizeLimitedMap.ids[key] = []string{element}
+ }
+}
+
+func (sizeLimitedMap *SizeLimitedMap) contains(key string, element string) bool {
+ if val, ok := sizeLimitedMap.ids[key]; ok {
+ for _, v := range val {
+ if v == element {
+ return true
+ }
+ }
+ }
+
+ return false
+}
+
+func (sizeLimitedMap *SizeLimitedMap) count() int {
+ return len(sizeLimitedMap.ids)
+}
diff --git a/vendor/github.com/posthog/posthog-go/version.go b/vendor/github.com/posthog/posthog-go/version.go
index bef466c6e2..1f8eca8ebf 100644
--- a/vendor/github.com/posthog/posthog-go/version.go
+++ b/vendor/github.com/posthog/posthog-go/version.go
@@ -3,7 +3,7 @@ package posthog
import "flag"
// Version of the client.
-const Version = "1.0.2"
+const Version = "1.4.1"
// make tests easier by using a constant version
func getVersion() string {
diff --git a/vendor/github.com/xtgo/uuid/AUTHORS b/vendor/github.com/xtgo/uuid/AUTHORS
deleted file mode 100644
index a6f0451607..0000000000
--- a/vendor/github.com/xtgo/uuid/AUTHORS
+++ /dev/null
@@ -1,5 +0,0 @@
-# This source file refers to The gocql Authors for copyright purposes.
-
-Christoph Hack
-Jonathan Rudenberg
-Thorsten von Eicken
diff --git a/vendor/github.com/xtgo/uuid/LICENSE b/vendor/github.com/xtgo/uuid/LICENSE
deleted file mode 100644
index 18d25f9234..0000000000
--- a/vendor/github.com/xtgo/uuid/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2012 The gocql Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/xtgo/uuid/uuid.go b/vendor/github.com/xtgo/uuid/uuid.go
deleted file mode 100644
index a0fd7a5a5c..0000000000
--- a/vendor/github.com/xtgo/uuid/uuid.go
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright (c) 2012 The gocql Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package uuid can be used to generate and parse universally unique
-// identifiers, a standardized format in the form of a 128 bit number.
-//
-// http://tools.ietf.org/html/rfc4122
-package uuid
-
-import (
- "crypto/rand"
- "encoding/hex"
- "errors"
- "io"
- "net"
- "strconv"
- "time"
-)
-
-type UUID [16]byte
-
-var hardwareAddr []byte
-
-const (
- VariantNCSCompat = 0
- VariantIETF = 2
- VariantMicrosoft = 6
- VariantFuture = 7
-)
-
-func init() {
- if interfaces, err := net.Interfaces(); err == nil {
- for _, i := range interfaces {
- if i.Flags&net.FlagLoopback == 0 && len(i.HardwareAddr) > 0 {
- hardwareAddr = i.HardwareAddr
- break
- }
- }
- }
- if hardwareAddr == nil {
- // If we failed to obtain the MAC address of the current computer,
- // we will use a randomly generated 6 byte sequence instead and set
- // the multicast bit as recommended in RFC 4122.
- hardwareAddr = make([]byte, 6)
- _, err := io.ReadFull(rand.Reader, hardwareAddr)
- if err != nil {
- panic(err)
- }
- hardwareAddr[0] = hardwareAddr[0] | 0x01
- }
-}
-
-// Parse parses a 32 digit hexadecimal number (that might contain hyphens)
-// representing an UUID.
-func Parse(input string) (UUID, error) {
- var u UUID
- j := 0
- for i := 0; i < len(input); i++ {
- b := input[i]
- switch {
- default:
- fallthrough
- case j == 32:
- goto err
- case b == '-':
- continue
- case '0' <= b && b <= '9':
- b -= '0'
- case 'a' <= b && b <= 'f':
- b -= 'a' - 10
- case 'A' <= b && b <= 'F':
- b -= 'A' - 10
- }
- u[j/2] |= b << byte(^j&1<<2)
- j++
- }
- if j == 32 {
- return u, nil
- }
-err:
- return UUID{}, errors.New("invalid UUID " + strconv.Quote(input))
-}
-
-// FromBytes converts a raw byte slice to an UUID. It will panic if the slice
-// isn't exactly 16 bytes long.
-func FromBytes(input []byte) UUID {
- var u UUID
- if len(input) != 16 {
- panic("UUIDs must be exactly 16 bytes long")
- }
- copy(u[:], input)
- return u
-}
-
-// NewRandom generates a totally random UUID (version 4) as described in
-// RFC 4122.
-func NewRandom() UUID {
- var u UUID
- io.ReadFull(rand.Reader, u[:])
- u[6] &= 0x0F // clear version
- u[6] |= 0x40 // set version to 4 (random uuid)
- u[8] &= 0x3F // clear variant
- u[8] |= 0x80 // set to IETF variant
- return u
-}
-
-var timeBase = time.Date(1582, time.October, 15, 0, 0, 0, 0, time.UTC).Unix()
-
-// NewTime generates a new time based UUID (version 1) as described in RFC
-// 4122. This UUID contains the MAC address of the node that generated the
-// UUID, a timestamp and a sequence number.
-func NewTime() UUID {
- var u UUID
-
- now := time.Now().In(time.UTC)
- t := uint64(now.Unix()-timeBase)*10000000 + uint64(now.Nanosecond()/100)
- u[0], u[1], u[2], u[3] = byte(t>>24), byte(t>>16), byte(t>>8), byte(t)
- u[4], u[5] = byte(t>>40), byte(t>>32)
- u[6], u[7] = byte(t>>56)&0x0F, byte(t>>48)
-
- var clockSeq [2]byte
- io.ReadFull(rand.Reader, clockSeq[:])
- u[8] = clockSeq[1]
- u[9] = clockSeq[0]
-
- copy(u[10:], hardwareAddr)
-
- u[6] |= 0x10 // set version to 1 (time based uuid)
- u[8] &= 0x3F // clear variant
- u[8] |= 0x80 // set to IETF variant
-
- return u
-}
-
-// String returns the UUID in it's canonical form, a 32 digit hexadecimal
-// number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
-func (u UUID) String() string {
- buf := [36]byte{8: '-', 13: '-', 18: '-', 23: '-'}
- hex.Encode(buf[0:], u[0:4])
- hex.Encode(buf[9:], u[4:6])
- hex.Encode(buf[14:], u[6:8])
- hex.Encode(buf[19:], u[8:10])
- hex.Encode(buf[24:], u[10:])
- return string(buf[:])
-}
-
-// Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits
-// (16 bytes) long.
-func (u UUID) Bytes() []byte {
- return u[:]
-}
-
-// Variant returns the variant of this UUID. This package will only generate
-// UUIDs in the IETF variant.
-func (u UUID) Variant() int {
- x := u[8]
- switch byte(0) {
- case x & 0x80:
- return VariantNCSCompat
- case x & 0x40:
- return VariantIETF
- case x & 0x20:
- return VariantMicrosoft
- }
- return VariantFuture
-}
-
-// Version extracts the version of this UUID variant. The RFC 4122 describes
-// five kinds of UUIDs.
-func (u UUID) Version() int {
- return int(u[6] & 0xF0 >> 4)
-}
-
-// Node extracts the MAC address of the node who generated this UUID. It will
-// return nil if the UUID is not a time based UUID (version 1).
-func (u UUID) Node() []byte {
- if u.Version() != 1 {
- return nil
- }
- return u[10:]
-}
-
-// Timestamp extracts the timestamp information from a time based UUID
-// (version 1).
-func (u UUID) Timestamp() uint64 {
- if u.Version() != 1 {
- return 0
- }
- return uint64(u[0])<<24 + uint64(u[1])<<16 + uint64(u[2])<<8 +
- uint64(u[3]) + uint64(u[4])<<40 + uint64(u[5])<<32 +
- uint64(u[7])<<48 + uint64(u[6]&0x0F)<<56
-}
-
-// Time is like Timestamp, except that it returns a time.Time.
-func (u UUID) Time() time.Time {
- t := u.Timestamp()
- if t == 0 {
- return time.Time{}
- }
- sec := t / 10000000
- nsec := t - sec
- return time.Unix(int64(sec)+timeBase, int64(nsec))
-}
diff --git a/vendor/gopkg.in/go-playground/validator.v9/README.md b/vendor/gopkg.in/go-playground/validator.v9/README.md
index 24318de0d6..b55f3ecfd4 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/README.md
+++ b/vendor/gopkg.in/go-playground/validator.v9/README.md
@@ -1,7 +1,9 @@
+**NOTICE:** v9 has entered maintenance status as of 2019-12-24. Please make all new functionality PR's against master.
+
Package validator
================
[](https://gitter.im/go-playground/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
+
[](https://semaphoreci.com/joeybloggs/validator)
[](https://coveralls.io/github/go-playground/validator?branch=v9)
[](https://goreportcard.com/report/github.com/go-playground/validator)
diff --git a/vendor/gopkg.in/go-playground/validator.v9/baked_in.go b/vendor/gopkg.in/go-playground/validator.v9/baked_in.go
index 95d613caf0..cfc5686d45 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/baked_in.go
+++ b/vendor/gopkg.in/go-playground/validator.v9/baked_in.go
@@ -103,6 +103,7 @@ var (
"rgba": isRGBA,
"hsl": isHSL,
"hsla": isHSLA,
+ "e164": isE164,
"email": isEmail,
"url": isURL,
"uri": isURI,
@@ -224,14 +225,28 @@ func isOneOf(fl FieldLevel) bool {
func isUnique(fl FieldLevel) bool {
field := fl.Field()
+ param := fl.Param()
v := reflect.ValueOf(struct{}{})
switch field.Kind() {
case reflect.Slice, reflect.Array:
- m := reflect.MakeMap(reflect.MapOf(field.Type().Elem(), v.Type()))
+ if param == "" {
+ m := reflect.MakeMap(reflect.MapOf(field.Type().Elem(), v.Type()))
+
+ for i := 0; i < field.Len(); i++ {
+ m.SetMapIndex(field.Index(i), v)
+ }
+ return field.Len() == m.Len()
+ }
+
+ sf, ok := field.Type().Elem().FieldByName(param)
+ if !ok {
+ panic(fmt.Sprintf("Bad field name %s", param))
+ }
+ m := reflect.MakeMap(reflect.MapOf(sf.Type, v.Type()))
for i := 0; i < field.Len(); i++ {
- m.SetMapIndex(field.Index(i), v)
+ m.SetMapIndex(field.Index(i).FieldByName(param), v)
}
return field.Len() == m.Len()
case reflect.Map:
@@ -1219,6 +1234,11 @@ func isFile(fl FieldLevel) bool {
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
}
+// IsE164 is the validation function for validating if the current field's value is a valid e.164 formatted phone number.
+func isE164(fl FieldLevel) bool {
+ return e164Regex.MatchString(fl.Field().String())
+}
+
// IsEmail is the validation function for validating if the current field's value is a valid email address.
func isEmail(fl FieldLevel) bool {
return emailRegex.MatchString(fl.Field().String())
@@ -1316,11 +1336,11 @@ func hasValue(fl FieldLevel) bool {
// requireCheckField is a func for check field kind
func requireCheckFieldKind(fl FieldLevel, param string, defaultNotFoundValue bool) bool {
field := fl.Field()
- var ok bool
kind := field.Kind()
+ var nullable, found bool
if len(param) > 0 {
- field, kind, ok = fl.GetStructFieldOKAdvanced(fl.Parent(), param)
- if !ok {
+ field, kind, nullable, found = fl.GetStructFieldOKAdvanced2(fl.Parent(), param)
+ if !found {
return defaultNotFoundValue
}
}
@@ -1328,9 +1348,12 @@ func requireCheckFieldKind(fl FieldLevel, param string, defaultNotFoundValue boo
case reflect.Invalid:
return defaultNotFoundValue
case reflect.Slice, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func:
- return !field.IsNil()
+ return field.IsNil()
default:
- return field.IsValid() && field.Interface() != reflect.Zero(field.Type()).Interface()
+ if nullable && field.Interface() != nil {
+ return false
+ }
+ return field.IsValid() && field.Interface() == reflect.Zero(field.Type()).Interface()
}
}
@@ -1339,7 +1362,7 @@ func requireCheckFieldKind(fl FieldLevel, param string, defaultNotFoundValue boo
func requiredWith(fl FieldLevel) bool {
params := parseOneOfParam2(fl.Param())
for _, param := range params {
- if requireCheckFieldKind(fl, param, false) {
+ if !requireCheckFieldKind(fl, param, true) {
return hasValue(fl)
}
}
@@ -1351,7 +1374,7 @@ func requiredWith(fl FieldLevel) bool {
func requiredWithAll(fl FieldLevel) bool {
params := parseOneOfParam2(fl.Param())
for _, param := range params {
- if !requireCheckFieldKind(fl, param, false) {
+ if requireCheckFieldKind(fl, param, true) {
return true
}
}
@@ -1361,11 +1384,8 @@ func requiredWithAll(fl FieldLevel) bool {
// RequiredWithout is the validation function
// The field under validation must be present and not empty only when any of the other specified fields are not present.
func requiredWithout(fl FieldLevel) bool {
- params := parseOneOfParam2(fl.Param())
- for _, param := range params {
- if !requireCheckFieldKind(fl, param, true) {
- return hasValue(fl)
- }
+ if requireCheckFieldKind(fl, strings.TrimSpace(fl.Param()), true) {
+ return hasValue(fl)
}
return true
}
@@ -1375,7 +1395,7 @@ func requiredWithout(fl FieldLevel) bool {
func requiredWithoutAll(fl FieldLevel) bool {
params := parseOneOfParam2(fl.Param())
for _, param := range params {
- if requireCheckFieldKind(fl, param, true) {
+ if !requireCheckFieldKind(fl, param, true) {
return true
}
}
diff --git a/vendor/gopkg.in/go-playground/validator.v9/doc.go b/vendor/gopkg.in/go-playground/validator.v9/doc.go
index e0396cb447..7ad9dea7f1 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/doc.go
+++ b/vendor/gopkg.in/go-playground/validator.v9/doc.go
@@ -585,9 +585,15 @@ Unique
For arrays & slices, unique will ensure that there are no duplicates.
For maps, unique will ensure that there are no duplicate values.
+For slices of struct, unique will ensure that there are no duplicate values
+in a field of the struct specified via a parameter.
+ // For arrays, slices, and maps:
Usage: unique
+ // For slices of struct:
+ Usage: unique=field
+
Alpha Only
This validates that a string value contains ASCII alpha characters only
@@ -1058,27 +1064,14 @@ Validator notes:
And the best reason, you can submit a pull request and we can keep on
adding to the validation library of this package!
-Panics
-
-This package panics when bad input is provided, this is by design, bad code like
-that should not make it to production.
-
- type Test struct {
- TestField string `validate:"nonexistantfunction=1"`
- }
-
- t := &Test{
- TestField: "Test"
- }
-
- validate.Struct(t) // this will panic
-
Non standard validators
A collection of validation rules that are frequently needed but are more
complex than the ones found in the baked in validators.
-A non standard validator must be registered manually using any tag you like.
-See below examples of registration and use.
+A non standard validator must be registered manually like you would
+with your own custom validation functions.
+
+Example of registration and use:
type Test struct {
TestField string `validate:"yourtag"`
@@ -1089,7 +1082,9 @@ See below examples of registration and use.
}
validate := validator.New()
- validate.RegisterValidation("yourtag", validations.ValidatorName)
+ validate.RegisterValidation("yourtag", validators.NotBlank)
+
+Here is a list of the current non standard validators:
NotBlank
This validates that the value is not blank or with length zero.
@@ -1097,5 +1092,20 @@ See below examples of registration and use.
ensures they don't have zero length. For others, a non empty value is required.
Usage: notblank
+
+Panics
+
+This package panics when bad input is provided, this is by design, bad code like
+that should not make it to production.
+
+ type Test struct {
+ TestField string `validate:"nonexistantfunction=1"`
+ }
+
+ t := &Test{
+ TestField: "Test"
+ }
+
+ validate.Struct(t) // this will panic
*/
package validator
diff --git a/vendor/gopkg.in/go-playground/validator.v9/field_level.go b/vendor/gopkg.in/go-playground/validator.v9/field_level.go
index 24bc134cb8..f0e2a9a855 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/field_level.go
+++ b/vendor/gopkg.in/go-playground/validator.v9/field_level.go
@@ -5,7 +5,6 @@ import "reflect"
// FieldLevel contains all the information and helper functions
// to validate a field
type FieldLevel interface {
-
// returns the top level struct, if any
Top() reflect.Value
@@ -26,6 +25,9 @@ type FieldLevel interface {
// returns param for validation against current field
Param() string
+ // GetTag returns the current validations tag name
+ GetTag() string
+
// ExtractType gets the actual underlying type of field value.
// It will dive into pointers, customTypes and return you the
// underlying value and it's kind.
@@ -37,11 +39,27 @@ type FieldLevel interface {
//
// NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field
// could not be retrieved because it didn't exist.
+ //
+ // Deprecated: Use GetStructFieldOK2() instead which also return if the value is nullable.
GetStructFieldOK() (reflect.Value, reflect.Kind, bool)
// GetStructFieldOKAdvanced is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
// the field and namespace allowing more extensibility for validators.
+ //
+ // Deprecated: Use GetStructFieldOKAdvanced2() instead which also return if the value is nullable.
GetStructFieldOKAdvanced(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool)
+
+ // traverses the parent struct to retrieve a specific field denoted by the provided namespace
+ // in the param and returns the field, field kind, if it's a nullable type and whether is was successful in retrieving
+ // the field at all.
+ //
+ // NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field
+ // could not be retrieved because it didn't exist.
+ GetStructFieldOK2() (reflect.Value, reflect.Kind, bool, bool)
+
+ // GetStructFieldOKAdvanced is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
+ // the field and namespace allowing more extensibility for validators.
+ GetStructFieldOKAdvanced2(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool, bool)
}
var _ FieldLevel = new(validate)
@@ -52,11 +70,16 @@ func (v *validate) Field() reflect.Value {
}
// FieldName returns the field's name with the tag
-// name takeing precedence over the fields actual name.
+// name taking precedence over the fields actual name.
func (v *validate) FieldName() string {
return v.cf.altName
}
+// GetTag returns the current validations tag name
+func (v *validate) GetTag() string {
+ return v.ct.tag
+}
+
// StructFieldName returns the struct field's name
func (v *validate) StructFieldName() string {
return v.cf.name
@@ -68,12 +91,29 @@ func (v *validate) Param() string {
}
// GetStructFieldOK returns Param returns param for validation against current field
+//
+// Deprecated: Use GetStructFieldOK2() instead which also return if the value is nullable.
func (v *validate) GetStructFieldOK() (reflect.Value, reflect.Kind, bool) {
- return v.getStructFieldOKInternal(v.slflParent, v.ct.param)
+ current, kind, _, found := v.getStructFieldOKInternal(v.slflParent, v.ct.param)
+ return current, kind, found
}
// GetStructFieldOKAdvanced is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
// the field and namespace allowing more extensibility for validators.
+//
+// Deprecated: Use GetStructFieldOKAdvanced2() instead which also return if the value is nullable.
func (v *validate) GetStructFieldOKAdvanced(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool) {
+ current, kind, _, found := v.GetStructFieldOKAdvanced2(val, namespace)
+ return current, kind, found
+}
+
+// GetStructFieldOK returns Param returns param for validation against current field
+func (v *validate) GetStructFieldOK2() (reflect.Value, reflect.Kind, bool, bool) {
+ return v.getStructFieldOKInternal(v.slflParent, v.ct.param)
+}
+
+// GetStructFieldOKAdvanced is the same as GetStructFieldOK except that it accepts the parent struct to start looking for
+// the field and namespace allowing more extensibility for validators.
+func (v *validate) GetStructFieldOKAdvanced2(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool, bool) {
return v.getStructFieldOKInternal(val, namespace)
}
diff --git a/vendor/gopkg.in/go-playground/validator.v9/regexes.go b/vendor/gopkg.in/go-playground/validator.v9/regexes.go
index 0253d7091d..7ba7c73937 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/regexes.go
+++ b/vendor/gopkg.in/go-playground/validator.v9/regexes.go
@@ -16,6 +16,7 @@ const (
hslRegexString = "^hsl\\(\\s*(?:0|[1-9]\\d?|[12]\\d\\d|3[0-5]\\d|360)\\s*,\\s*(?:(?:0|[1-9]\\d?|100)%)\\s*,\\s*(?:(?:0|[1-9]\\d?|100)%)\\s*\\)$"
hslaRegexString = "^hsla\\(\\s*(?:0|[1-9]\\d?|[12]\\d\\d|3[0-5]\\d|360)\\s*,\\s*(?:(?:0|[1-9]\\d?|100)%)\\s*,\\s*(?:(?:0|[1-9]\\d?|100)%)\\s*,\\s*(?:(?:0.[1-9]*)|[01])\\s*\\)$"
emailRegexString = "^(?:(?:(?:(?:[a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(?:\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|(?:(?:\\x22)(?:(?:(?:(?:\\x20|\\x09)*(?:\\x0d\\x0a))?(?:\\x20|\\x09)+)?(?:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(?:(?:[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(?:(?:(?:\\x20|\\x09)*(?:\\x0d\\x0a))?(\\x20|\\x09)+)?(?:\\x22))))@(?:(?:(?:[a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(?:(?:[a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])(?:[a-zA-Z]|\\d|-|\\.|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*(?:[a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(?:(?:[a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(?:(?:[a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])(?:[a-zA-Z]|\\d|-|\\.|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*(?:[a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$"
+ e164RegexString = "^\\+[1-9]?[0-9]{7,14}$"
base64RegexString = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$"
base64URLRegexString = "^(?:[A-Za-z0-9-_]{4})*(?:[A-Za-z0-9-_]{2}==|[A-Za-z0-9-_]{3}=|[A-Za-z0-9-_]{4})$"
iSBN10RegexString = "^(?:[0-9]{9}X|[0-9]{10})$"
@@ -61,6 +62,7 @@ var (
rgbaRegex = regexp.MustCompile(rgbaRegexString)
hslRegex = regexp.MustCompile(hslRegexString)
hslaRegex = regexp.MustCompile(hslaRegexString)
+ e164Regex = regexp.MustCompile(e164RegexString)
emailRegex = regexp.MustCompile(emailRegexString)
base64Regex = regexp.MustCompile(base64RegexString)
base64URLRegex = regexp.MustCompile(base64URLRegexString)
diff --git a/vendor/gopkg.in/go-playground/validator.v9/util.go b/vendor/gopkg.in/go-playground/validator.v9/util.go
index 16a5517c97..71acbdc44d 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/util.go
+++ b/vendor/gopkg.in/go-playground/validator.v9/util.go
@@ -57,11 +57,10 @@ BEGIN:
//
// NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field
// could not be retrieved because it didn't exist.
-func (v *validate) getStructFieldOKInternal(val reflect.Value, namespace string) (current reflect.Value, kind reflect.Kind, found bool) {
+func (v *validate) getStructFieldOKInternal(val reflect.Value, namespace string) (current reflect.Value, kind reflect.Kind, nullable bool, found bool) {
BEGIN:
- current, kind, _ = v.ExtractType(val)
-
+ current, kind, nullable = v.ExtractType(val)
if kind == reflect.Invalid {
return
}
@@ -112,7 +111,7 @@ BEGIN:
arrIdx, _ := strconv.Atoi(namespace[idx+1 : idx2])
if arrIdx >= current.Len() {
- return current, kind, false
+ return
}
startIdx := idx2 + 1
diff --git a/vendor/gopkg.in/go-playground/validator.v9/validator.go b/vendor/gopkg.in/go-playground/validator.v9/validator.go
index 3abf5d33ad..342e72e315 100644
--- a/vendor/gopkg.in/go-playground/validator.v9/validator.go
+++ b/vendor/gopkg.in/go-playground/validator.v9/validator.go
@@ -7,7 +7,7 @@ import (
"strconv"
)
-// per validate contruct
+// per validate construct
type validate struct {
v *Validate
top reflect.Value
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 9a313671b7..c9e1de8404 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -342,7 +342,7 @@ github.com/davecgh/go-spew/spew
# github.com/deckarep/golang-set v1.8.0
## explicit; go 1.17
github.com/deckarep/golang-set
-# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250327100051-86261f25ea82
+# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250401095543-affde454fe43
## explicit; go 1.21
github.com/devtron-labs/authenticator/apiToken
github.com/devtron-labs/authenticator/client
@@ -350,7 +350,7 @@ github.com/devtron-labs/authenticator/jwt
github.com/devtron-labs/authenticator/middleware
github.com/devtron-labs/authenticator/oidc
github.com/devtron-labs/authenticator/password
-# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250327100051-86261f25ea82
+# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250401095543-affde454fe43
## explicit; go 1.21
github.com/devtron-labs/common-lib/async
github.com/devtron-labs/common-lib/blob-storage
@@ -535,12 +535,12 @@ github.com/go-pg/pg/internal/parser
github.com/go-pg/pg/internal/pool
github.com/go-pg/pg/orm
github.com/go-pg/pg/types
-# github.com/go-playground/locales v0.14.0
-## explicit; go 1.13
+# github.com/go-playground/locales v0.14.1
+## explicit; go 1.17
github.com/go-playground/locales
github.com/go-playground/locales/currency
-# github.com/go-playground/universal-translator v0.18.0
-## explicit; go 1.13
+# github.com/go-playground/universal-translator v0.18.1
+## explicit; go 1.18
github.com/go-playground/universal-translator
# github.com/go-redis/cache/v9 v9.0.0
## explicit; go 1.13
@@ -777,11 +777,9 @@ github.com/josharian/intern
# github.com/json-iterator/go v1.1.12
## explicit; go 1.12
github.com/json-iterator/go
-# github.com/juju/errors v0.0.0-20200330140219-3fe23663418f
-## explicit
+# github.com/juju/errors v1.0.0
+## explicit; go 1.18
github.com/juju/errors
-# github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098
-## explicit; go 1.14
# github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
## explicit
github.com/kballard/go-shellquote
@@ -792,9 +790,10 @@ github.com/kevinburke/ssh_config
## explicit; go 1.18
github.com/klauspost/compress/flate
github.com/klauspost/compress/s2
-# github.com/leodido/go-urn v1.2.0
-## explicit; go 1.13
+# github.com/leodido/go-urn v1.4.0
+## explicit; go 1.18
github.com/leodido/go-urn
+github.com/leodido/go-urn/scim/schema
# github.com/lib/pq v1.10.9
## explicit; go 1.13
github.com/lib/pq
@@ -903,8 +902,8 @@ github.com/pkg/errors
# github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
## explicit
github.com/pmezard/go-difflib/difflib
-# github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a
-## explicit; go 1.15
+# github.com/posthog/posthog-go v1.4.1
+## explicit; go 1.18
github.com/posthog/posthog-go
# github.com/prometheus/client_golang v1.18.0
## explicit; go 1.19
@@ -1029,9 +1028,6 @@ github.com/xeipuuv/gojsonschema
# github.com/xlab/treeprint v1.2.0
## explicit; go 1.13
github.com/xlab/treeprint
-# github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c
-## explicit
-github.com/xtgo/uuid
# github.com/yannh/kubeconform v0.5.0
## explicit; go 1.17
github.com/yannh/kubeconform/pkg/cache
@@ -1436,9 +1432,7 @@ google.golang.org/protobuf/types/known/wrapperspb
# gopkg.in/evanphx/json-patch.v4 v4.12.0
## explicit
gopkg.in/evanphx/json-patch.v4
-# gopkg.in/go-playground/assert.v1 v1.2.1
-## explicit
-# gopkg.in/go-playground/validator.v9 v9.30.0
+# gopkg.in/go-playground/validator.v9 v9.31.0
## explicit
gopkg.in/go-playground/validator.v9
# gopkg.in/igm/sockjs-go.v3 v3.0.0
@@ -2226,8 +2220,8 @@ xorm.io/xorm/log
xorm.io/xorm/names
xorm.io/xorm/schemas
xorm.io/xorm/tags
-# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250327100051-86261f25ea82
-# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250327100051-86261f25ea82
+# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250401095543-affde454fe43
+# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250401095543-affde454fe43
# github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127
# github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
# k8s.io/api => k8s.io/api v0.29.7
diff --git a/wire_gen.go b/wire_gen.go
index b1ec4db5c5..b8264c531a 100644
--- a/wire_gen.go
+++ b/wire_gen.go
@@ -573,7 +573,7 @@ func InitializeApp() (*App, error) {
}
scanToolMetadataRepositoryImpl := repository15.NewScanToolMetadataRepositoryImpl(db, sugaredLogger)
scanToolMetadataServiceImpl := scanTool.NewScanToolMetadataServiceImpl(sugaredLogger, scanToolMetadataRepositoryImpl)
- moduleServiceImpl := module.NewModuleServiceImpl(sugaredLogger, serverEnvConfigServerEnvConfig, moduleRepositoryImpl, moduleActionAuditLogRepositoryImpl, helmAppServiceImpl, serverDataStoreServerDataStore, serverCacheServiceImpl, moduleCacheServiceImpl, moduleCronServiceImpl, moduleServiceHelperImpl, moduleResourceStatusRepositoryImpl, scanToolMetadataServiceImpl)
+ moduleServiceImpl := module.NewModuleServiceImpl(sugaredLogger, serverEnvConfigServerEnvConfig, moduleRepositoryImpl, moduleActionAuditLogRepositoryImpl, helmAppServiceImpl, serverDataStoreServerDataStore, serverCacheServiceImpl, moduleCacheServiceImpl, moduleCronServiceImpl, moduleServiceHelperImpl, moduleResourceStatusRepositoryImpl, scanToolMetadataServiceImpl, environmentVariables, moduleEnvConfig)
eventRESTClientImpl := client2.NewEventRESTClientImpl(sugaredLogger, httpClient, eventClientConfig, pubSubClientServiceImpl, ciPipelineRepositoryImpl, pipelineRepositoryImpl, attributesRepositoryImpl, moduleServiceImpl)
cdWorkflowRepositoryImpl := pipelineConfig.NewCdWorkflowRepositoryImpl(db, sugaredLogger)
ciWorkflowRepositoryImpl := pipelineConfig.NewCiWorkflowRepositoryImpl(db, sugaredLogger)
@@ -701,7 +701,7 @@ func InitializeApp() (*App, error) {
deploymentGroupRepositoryImpl := repository2.NewDeploymentGroupRepositoryImpl(sugaredLogger, db)
pipelineStrategyHistoryRepositoryImpl := repository21.NewPipelineStrategyHistoryRepositoryImpl(sugaredLogger, db)
pipelineStrategyHistoryServiceImpl := history.NewPipelineStrategyHistoryServiceImpl(sugaredLogger, pipelineStrategyHistoryRepositoryImpl, userServiceImpl)
- propertiesConfigServiceImpl := pipeline.NewPropertiesConfigServiceImpl(sugaredLogger, envConfigOverrideRepositoryImpl, chartRepositoryImpl, environmentRepositoryImpl, deploymentTemplateHistoryServiceImpl, scopedVariableManagerImpl, deployedAppMetricsServiceImpl, envConfigOverrideReadServiceImpl, deploymentConfigServiceImpl)
+ propertiesConfigServiceImpl := pipeline.NewPropertiesConfigServiceImpl(sugaredLogger, envConfigOverrideRepositoryImpl, chartRepositoryImpl, environmentRepositoryImpl, deploymentTemplateHistoryServiceImpl, scopedVariableManagerImpl, deployedAppMetricsServiceImpl, envConfigOverrideReadServiceImpl, deploymentConfigServiceImpl, chartServiceImpl)
installedAppDBExtendedServiceImpl := FullMode.NewInstalledAppDBExtendedServiceImpl(installedAppDBServiceImpl, appStatusServiceImpl, gitOpsConfigReadServiceImpl)
gitOpsValidationServiceImpl := validation.NewGitOpsValidationServiceImpl(sugaredLogger, gitFactory, gitOperationServiceImpl, gitOpsConfigReadServiceImpl, chartTemplateServiceImpl, chartServiceImpl, installedAppDBExtendedServiceImpl)
imageDigestPolicyServiceImpl := imageDigestPolicy.NewImageDigestPolicyServiceImpl(sugaredLogger, qualifierMappingServiceImpl, devtronResourceSearchableKeyServiceImpl)
@@ -731,7 +731,7 @@ func InitializeApp() (*App, error) {
deploymentTemplateValidationServiceImpl := deploymentTemplate.NewDeploymentTemplateValidationServiceImpl(sugaredLogger, chartRefServiceImpl, scopedVariableManagerImpl)
devtronAppGitOpConfigServiceImpl := gitOpsConfig.NewDevtronAppGitOpConfigServiceImpl(sugaredLogger, chartRepositoryImpl, chartServiceImpl, gitOpsConfigReadServiceImpl, gitOpsValidationServiceImpl, argoClientWrapperServiceImpl, deploymentConfigServiceImpl, chartReadServiceImpl)
cdHandlerImpl := pipeline.NewCdHandlerImpl(sugaredLogger, userServiceImpl, cdWorkflowRepositoryImpl, ciLogServiceImpl, ciArtifactRepositoryImpl, ciPipelineMaterialRepositoryImpl, pipelineRepositoryImpl, environmentRepositoryImpl, ciWorkflowRepositoryImpl, enforcerUtilImpl, resourceGroupServiceImpl, imageTaggingServiceImpl, k8sServiceImpl, workflowServiceImpl, clusterServiceImplExtended, blobStorageConfigServiceImpl, customTagServiceImpl, deploymentConfigServiceImpl, workFlowStageStatusServiceImpl, cdWorkflowRunnerServiceImpl)
- appWorkflowServiceImpl := appWorkflow2.NewAppWorkflowServiceImpl(sugaredLogger, appWorkflowRepositoryImpl, ciCdPipelineOrchestratorImpl, ciPipelineRepositoryImpl, pipelineRepositoryImpl, enforcerUtilImpl, resourceGroupServiceImpl, appRepositoryImpl, userAuthServiceImpl, chartServiceImpl, deploymentConfigServiceImpl)
+ appWorkflowServiceImpl := appWorkflow2.NewAppWorkflowServiceImpl(sugaredLogger, appWorkflowRepositoryImpl, ciCdPipelineOrchestratorImpl, ciPipelineRepositoryImpl, pipelineRepositoryImpl, enforcerUtilImpl, resourceGroupServiceImpl, appRepositoryImpl, userAuthServiceImpl, chartServiceImpl, deploymentConfigServiceImpl, pipelineBuilderImpl)
appCloneServiceImpl := appClone.NewAppCloneServiceImpl(sugaredLogger, pipelineBuilderImpl, attributesServiceImpl, chartServiceImpl, configMapServiceImpl, appWorkflowServiceImpl, appListingServiceImpl, propertiesConfigServiceImpl, pipelineStageServiceImpl, ciTemplateReadServiceImpl, appRepositoryImpl, ciPipelineRepositoryImpl, pipelineRepositoryImpl, ciPipelineConfigServiceImpl, gitOpsConfigReadServiceImpl, chartReadServiceImpl)
deploymentTemplateRepositoryImpl := repository2.NewDeploymentTemplateRepositoryImpl(db, sugaredLogger)
deploymentTemplateHistoryReadServiceImpl := read7.NewDeploymentTemplateHistoryReadServiceImpl(sugaredLogger, deploymentTemplateHistoryRepositoryImpl, scopedVariableManagerImpl)