Skip to content

Commit

Permalink
Merge pull request #39 from wallix/develop
Browse files Browse the repository at this point in the history
Release v0.14.0
  • Loading branch information
bsimonWallix authored Nov 8, 2024
2 parents dd81114 + e05c6bc commit c4b1741
Show file tree
Hide file tree
Showing 64 changed files with 1,190 additions and 1,494 deletions.
Empty file added .changes/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions .changes/.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- markdownlint-disable-file MD013 MD041 -->
FEATURES:

ENHANCEMENTS:

BUG FIXES:
23 changes: 13 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Go Tests
on: [push, pull_request]
jobs:
build-1_20:
name: Build 1.20
build-1_22:
name: Build 1.22
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: false
id: go
- name: Disable cgo
run: |
Expand All @@ -21,15 +22,16 @@ jobs:
- name: Build
run: go build -v .

build-1_21:
name: Build 1.21
build-1_23:
name: Build 1.23
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
check-latest: true
cache: false
id: go
- name: Disable cgo
run: |
Expand All @@ -45,11 +47,12 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
check-latest: true
cache: false
id: go
- name: Disable cgo
run: |
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
check-latest: true
id: go
- name: Disable cgo
Expand All @@ -17,10 +17,11 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
version: v1.61.0
args: -c .golangci.yml -v
skip-cache: true

markdown-lint:
name: markdown-lint
Expand All @@ -38,11 +39,12 @@ jobs:
name: terrafmt
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
check-latest: true
skip-cache: true
id: go
- name: Show version
run: go version
Expand All @@ -54,6 +56,7 @@ jobs:
repository: katbyte/terrafmt
ref: v0.5.2
path: terrafmt
skip-cache: true
- name: Build terrafmt bin
run: cd terrafmt && go install ./... && cd ${GITHUB_WORKSPACE}
- name: Detect resource/data-source blocks without double quote on type and name (blocks not detected by terrafmt)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ jobs:
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
-
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.1.0
uses: crazy-max/ghaction-import-gpg@v6.2.0
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5.0.0
uses: goreleaser/goreleaser-action@v6.0.0
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
Expand Down
43 changes: 22 additions & 21 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
run:
timeout: 5m

linters:
enable-all: true
disable:
# maligned # deprecated 1.38.0 but govet-fieldalignment not usuable
- interfacer # deprecated 1.38.0
- scopelint # deprecated 1.39.0
- golint # deprecated 1.41.0
- exhaustivestruct # deprecated 1.46.0
# ifshort # deprecated 1.48.0 but no replacement
- nosnakecase # deprecated 1.48.1
- deadcode # deprecated 1.49.0
- structcheck # deprecated 1.49.0
- varcheck # deprecated 1.49.0
- funlen
# deprecated
- execinquery # deprecated 1.58.0
- gomnd # deprecated 1.58.0
- exportloopref # deprecated 1.60.2
# unwanted
- cyclop
- depguard
- dupl
- wsl
- gomnd
- goerr113
- nestif
- err113
- exhaustruct
- paralleltest
- gci
- cyclop
- forcetypeassert
- tagliatelle
- funlen
- gomoddirectives
- mnd
- nestif
- paralleltest
- tagliatelle
- varnamelen
- depguard
- wsl

linters-settings:
gci:
custom-order: true
sections:
- standard
- localModule
- default
govet:
enable-all: true
disable:
Expand All @@ -39,4 +41,3 @@ linters-settings:
gocyclo:
# minimal code complexity to report, 30 by default
min-complexity: 30

3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -40,4 +41,4 @@ signs:
release:
draft: true
changelog:
skip: true
disable: true
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# changelog

## 0.14.0 (November 08, 2024)

BREAKING CHANGES:

* remove compatibility with API version 3.3 and 3.6
* remove resource `wallix-bastion_ldapdomain`
* remove resource `wallix-bastion_ldapmapping`
* default provider api_version argument is now `v3.8`
* user statement is now mandatory

FEATURES:

* add compatibility with API version 3.12

ENHANCEMENTS:

* **resource/wallix-bastion_application**:
* add `category`, `application_url`, `browser`, `browser_version` arguments to be able to add `jumphost` application (not tested)
* `paths` and `target` is now only required when `category` = `standard`
* **resource/wallix-bastion_connection_policy**: add `type` argument with default value as `protocol` value
* **resource/wallix-bastion_externalauth_saml**: add `claim_customization` block argument

## 0.13.0 (March 08, 2024)

* build(deps): bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 by @dependabot in https://github.com/wallix/terraform-provider-wallix-bastion/pull/13
* added http basic authentication by @moulip in https://github.com/wallix/terraform-provider-wallix-bastion/pull/15

## 0.12.2 (January 03, 2024)

* Corrected and added documentation example
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### In addition to develop

- [Go](https://golang.org/doc/install) `v1.20` or `v1.21`
- [Go](https://golang.org/doc/install) `v1.22` or `v1.23`

### Special Thanks

Expand Down
8 changes: 4 additions & 4 deletions bastion/data_source_configoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"encoding/json"
"fmt"
"net/http"
"slices"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
balt "github.com/jeremmfr/go-utils/basicalter"
bchk "github.com/jeremmfr/go-utils/basiccheck"
)

type jsonConfigOptions struct {
Expand Down Expand Up @@ -57,7 +57,7 @@ func dataSourceConfigoption() *schema.Resource {
}

func dataSourceConfigoptionVersionCheck(version string) error {
if bchk.InSlice(version, defaultVersionsValid()) {
if slices.Contains(defaultVersionsValid(), version) {
return nil
}

Expand Down Expand Up @@ -94,7 +94,7 @@ func readConfigoption(
for _, v := range optionsList {
params += v.(string) + ","
}
_ = balt.CutPrefixInString(&params, ",")
params = strings.TrimSuffix(params, ",")
}
body, code, err := c.newRequest(ctx, "/configoptions/"+d.Get("config_id").(string)+params, http.MethodGet, nil)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions bastion/data_source_configoption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package bastion_test

import (
"encoding/json"
"fmt"
"errors"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down Expand Up @@ -30,7 +30,7 @@ func TestAccDataSourceConfigoption_basic(t *testing.T) {
return err
}
if jsonData["name"].(string) != "one_time_password_ttl" {
return fmt.Errorf("can't find name=one_time_password_ttl in json")
return errors.New("can't find name=one_time_password_ttl in json")
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions bastion/data_source_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package bastion
import (
"context"
"fmt"
"slices"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
bchk "github.com/jeremmfr/go-utils/basiccheck"
)

func dataSourceDomain() *schema.Resource {
Expand Down Expand Up @@ -54,7 +54,7 @@ func dataSourceDomain() *schema.Resource {
}

func dataSourceDomainVersionCheck(version string) error {
if bchk.InSlice(version, defaultVersionsValid()) {
if slices.Contains(defaultVersionsValid(), version) {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions bastion/data_source_local_password_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"encoding/json"
"fmt"
"net/http"
"slices"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
bchk "github.com/jeremmfr/go-utils/basiccheck"
)

type jsonLocalPasswordPolicy struct {
Expand Down Expand Up @@ -97,7 +97,7 @@ func dataSourceLocalPasswordPolicy() *schema.Resource {
}

func dataSourceLocalPasswordPolicyVersionCheck(version string) error {
if bchk.InSlice(version, defaultVersionsValid()) {
if slices.Contains(defaultVersionsValid(), version) {
return nil
}

Expand Down
Loading

0 comments on commit c4b1741

Please sign in to comment.