Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/hashicorp/t…
Browse files Browse the repository at this point in the history
…erraform-plugin-go-0.20.0
  • Loading branch information
alexhung authored Dec 19, 2023
2 parents dcfb0c6 + 42d8bb8 commit 34701d2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
11 changes: 10 additions & 1 deletion docs/resources/workers_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ resource "platform_workers_service" "my-workers-service" {
key = "my-workers-service"
enabled = true
description = "My workers service"
source_code = "export default async (context: PlatformContext, data: BeforeDownloadRequest): Promise<BeforeDownloadResponse> => { console.log(await context.clients.platformHttp.get('/artifactory/api/system/ping')); console.log(await axios.get('https://my.external.resource')); return { status: 'DOWNLOAD_PROCEED', message: 'proceed', } }"
source_code = <<EOT
export default async (context: PlatformContext, data: BeforeDownloadRequest): Promise<BeforeDownloadResponse> => {
console.log(await context.clients.platformHttp.get('/artifactory/api/system/ping'));
console.log(await axios.get('https://my.external.resource'));
return {
status: 'DOWNLOAD_PROCEED',
message: 'proceed',
}
}
EOT
action = "BEFORE_DOWNLOAD"
filter_criteria = {
Expand Down
11 changes: 10 additions & 1 deletion examples/resources/platform_workers_service/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ resource "platform_workers_service" "my-workers-service" {
key = "my-workers-service"
enabled = true
description = "My workers service"
source_code = "export default async (context: PlatformContext, data: BeforeDownloadRequest): Promise<BeforeDownloadResponse> => { console.log(await context.clients.platformHttp.get('/artifactory/api/system/ping')); console.log(await axios.get('https://my.external.resource')); return { status: 'DOWNLOAD_PROCEED', message: 'proceed', } }"
source_code = <<EOT
export default async (context: PlatformContext, data: BeforeDownloadRequest): Promise<BeforeDownloadResponse> => {
console.log(await context.clients.platformHttp.get('/artifactory/api/system/ping'));
console.log(await axios.get('https://my.external.resource'));
return {
status: 'DOWNLOAD_PROCEED',
message: 'proceed',
}
}
EOT
action = "BEFORE_DOWNLOAD"

filter_criteria = {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ require (
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
Expand Down
17 changes: 13 additions & 4 deletions sample.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ terraform {
required_providers {
platform = {
source = "registry.terraform.io/jfrog/platform"
version = "1.0.0"
version = "1.0.2"
}
}
}

variable "jfrog_url" {
type = string
default = "http://localhost:8081"
default = "https://my.jfrog.io"
}

provider "platform" {
Expand All @@ -21,8 +21,17 @@ resource "platform_workers_service" "my-workers-service" {
key = "my-workers-service"
enabled = true
description = "My workers service"
source_code = "export default async (context: PlatformContext, data: BeforeDownloadRequest): Promise<BeforeDownloadResponse> => { console.log(await context.clients.platformHttp.get('/artifactory/api/system/ping')); console.log(await axios.get('https://my.external.resource')); return { status: 'DOWNLOAD_PROCEED', message: 'proceed', } }"
action = "BEFORE_DOWNLOAD"
source_code = <<EOT
export default async (context: PlatformContext, data: BeforeDownloadRequest): Promise<BeforeDownloadResponse> => {
console.log(await context.clients.platform Http.get('/artifactory/api/system/ping'));
console.log(await axios.get('https://my.external.resource'));
return {
status: 'DOWNLOAD_PROCEED',
message: 'proceed',
}
}
EOT
action = "BEFORE_DOWNLOAD"

filter_criteria = {
artifact_filter_criteria = {
Expand Down

0 comments on commit 34701d2

Please sign in to comment.