Skip to content

Commit c4c57d3

Browse files
authored
Merge pull request #1 from pomerium/wasaga/poc
2 parents 2106750 + d7a4d38 commit c4c57d3

17 files changed

+1476
-32
lines changed

.github/workflows/security.yml

-28
This file was deleted.

.github/workflows/test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ jobs:
4545
go-version: '1.23'
4646
cache: true
4747

48-
- name: golangci-lint
49-
uses: golangci/golangci-lint-action@v3
48+
- name: Run golangci-lint
49+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
5050
with:
51-
version: latest
51+
version: v1.60.1
52+
args: --timeout=10m
53+
skip-cache: true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ go.work.sum
2323

2424
# env file
2525
.env
26+
.DS_Store

.golangci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ linters:
1717
- dogsled
1818
- errcheck
1919
- errorlint
20-
- exportloopref
20+
- copyloopvar
2121
# - gci # https://github.com/daixiang0/gci/issues/209
2222
- gocheckcompilerdirectives
2323
- gofumpt
@@ -50,6 +50,10 @@ issues:
5050
- "SA1019"
5151

5252
exclude-rules:
53+
# allow tls skip verify
54+
- path: internal/provider/provider.go
55+
linters:
56+
- gosec
5357
# Exclude some linters from running on test files.
5458
- path: _test\.go$|^test/|^examples/|templates\.go$
5559
linters:

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
.PHONY: lint
3+
lint:
4+
@echo "@==> $@"
5+
@VERSION=$$(go run github.com/mikefarah/yq/[email protected] '.jobs.lint.steps[] | select(.uses == "golangci/golangci-lint-action*") | .with.version' .github/workflows/test.yml) && \
6+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$$VERSION run --fix --timeout=20m ./...

example/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.terraform
2+
.terraform.lock.hcl
3+
terraform.tfstate
4+
terraform.tfstate.backup
5+
terraform.tfvars

example/main.tf

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
terraform {
2+
required_providers {
3+
pomerium = {
4+
source = "github.com/pomerium/enterprise-terraform-provider"
5+
version = "0.0.1"
6+
}
7+
}
8+
}
9+
10+
variable "pomerium_service_account_token" {
11+
type = string
12+
sensitive = true
13+
}
14+
15+
provider "pomerium" {
16+
api_url = "https://console-api.localhost.pomerium.io"
17+
tls_insecure_skip_verify = true
18+
service_account_token = var.pomerium_service_account_token
19+
}
20+
21+
resource "pomerium_namespace" "test_namespace" {
22+
name = "test-namespace"
23+
parent_id = "9d8dbd2c-8cce-4e66-9c1f-c490b4a07243"
24+
}
25+
26+
resource "pomerium_policy" "test_policy" {
27+
name = "test-policy"
28+
namespace_id = pomerium_namespace.test_namespace.id
29+
ppl = <<EOF
30+
- allow:
31+
and:
32+
- authenticated_user: true
33+
EOF
34+
}
35+
36+
resource "pomerium_route" "test_route" {
37+
name = "test-route"
38+
namespace_id = pomerium_namespace.test_namespace.id
39+
from = "https://verify-tf.localhost.pomerium.io"
40+
to = ["https://verify.pomerium.com"]
41+
policies = [pomerium_policy.test_policy.id]
42+
}

go.mod

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
module github.com/pomerium/enterprise-terraform-provider
2+
3+
go 1.23.0
4+
5+
require (
6+
github.com/docker/cli v26.1.4+incompatible
7+
github.com/hashicorp/terraform-plugin-framework v1.11.0
8+
github.com/hashicorp/terraform-plugin-log v0.9.0
9+
github.com/pomerium/enterprise-client-go v0.18.1-0.20240903154554-9b855ec72cfd
10+
github.com/rs/zerolog v1.33.0
11+
github.com/stretchr/testify v1.9.0
12+
google.golang.org/grpc v1.66.2
13+
)
14+
15+
require (
16+
cel.dev/expr v0.16.1 // indirect
17+
github.com/caddyserver/certmagic v0.21.3 // indirect
18+
github.com/caddyserver/zerossl v0.1.3 // indirect
19+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
20+
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
21+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
22+
github.com/envoyproxy/go-control-plane v0.13.0 // indirect
23+
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
24+
github.com/fatih/color v1.13.0 // indirect
25+
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
26+
github.com/golang/protobuf v1.5.4 // indirect
27+
github.com/google/btree v1.1.3 // indirect
28+
github.com/google/uuid v1.6.0 // indirect
29+
github.com/hashicorp/errwrap v1.1.0 // indirect
30+
github.com/hashicorp/go-hclog v1.5.0 // indirect
31+
github.com/hashicorp/go-multierror v1.1.1 // indirect
32+
github.com/hashicorp/go-plugin v1.6.0 // indirect
33+
github.com/hashicorp/go-uuid v1.0.3 // indirect
34+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
35+
github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect
36+
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
37+
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
38+
github.com/hashicorp/yamux v0.1.1 // indirect
39+
github.com/jxskiss/base62 v1.1.0 // indirect
40+
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
41+
github.com/libdns/libdns v0.2.2 // indirect
42+
github.com/mattn/go-colorable v0.1.13 // indirect
43+
github.com/mattn/go-isatty v0.0.20 // indirect
44+
github.com/mholt/acmez/v2 v2.0.2 // indirect
45+
github.com/miekg/dns v1.1.62 // indirect
46+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
47+
github.com/oklog/run v1.0.0 // indirect
48+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
49+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
50+
github.com/pomerium/pomerium v0.27.0 // indirect
51+
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
52+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
53+
github.com/zeebo/blake3 v0.2.4 // indirect
54+
go.uber.org/multierr v1.11.0 // indirect
55+
go.uber.org/zap v1.27.0 // indirect
56+
golang.org/x/crypto v0.27.0 // indirect
57+
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
58+
golang.org/x/mod v0.21.0 // indirect
59+
golang.org/x/net v0.29.0 // indirect
60+
golang.org/x/sync v0.8.0 // indirect
61+
golang.org/x/sys v0.25.0 // indirect
62+
golang.org/x/text v0.18.0 // indirect
63+
golang.org/x/tools v0.25.0 // indirect
64+
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
65+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
66+
google.golang.org/protobuf v1.34.2 // indirect
67+
gopkg.in/yaml.v3 v3.0.1 // indirect
68+
)

0 commit comments

Comments
 (0)