From 4a61a29c90cc9737688f975b69d2249e820b5855 Mon Sep 17 00:00:00 2001 From: Henry Recker Date: Wed, 16 Oct 2024 10:53:36 -0500 Subject: [PATCH 1/5] Test change --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ab0cde..b9f5829 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains a Go client for interacting with the PingFederate admin API. It is generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -For a client tied to a specific version, add a version qualifier matching the PingFederate version to your `require` in `go.mod`. +For a client tied to a specific version, add a version qualifier matching the PingFederate version to your `require` in `go.mod`. For example, for a client for PingFederate 11.2.5: ``` @@ -11,4 +11,4 @@ require github.com/pingidentity/pingfederate-go-client/v1125 v1125.6.0 The `.6.0` refers to the version of this client module. -For detailed documentation, see the `README` and `docs/` folder in the `configurationapi/` folder. \ No newline at end of file +For detailed documentation, see the `README` and `docs/` folder in the `configurationapi/` folder. From 3abaf6ea6624d35160b2cfd01fb4dc259fc242a9 Mon Sep 17 00:00:00 2001 From: Henry Recker Date: Wed, 16 Oct 2024 10:54:35 -0500 Subject: [PATCH 2/5] Update workflow condition --- .github/workflows/code-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-check.yaml b/.github/workflows/code-check.yaml index 911b6d0..fd8d36c 100644 --- a/.github/workflows/code-check.yaml +++ b/.github/workflows/code-check.yaml @@ -3,10 +3,10 @@ name: Code Check on: pull_request: branches: - - "main" + - "v1210" push: branches: - - "main" + - "v1210" permissions: contents: read From 2de87fa0ca83824748b7e6b337e7a818ca9f7cad Mon Sep 17 00:00:00 2001 From: Henry Recker Date: Wed, 16 Oct 2024 11:04:13 -0500 Subject: [PATCH 3/5] Update go version and workflow branches --- .github/workflows/gosec-scan.yml | 4 ++-- README.md | 2 +- go.mod | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gosec-scan.yml b/.github/workflows/gosec-scan.yml index a6e5c5b..0117c1b 100644 --- a/.github/workflows/gosec-scan.yml +++ b/.github/workflows/gosec-scan.yml @@ -4,9 +4,9 @@ name: "Security Scan" # The scheduled workflow runs every at 00:00 on Sunday UTC time. on: push: - branches: [ "main" ] + branches: [ "v1210" ] pull_request: - branches: [ "main" ] + branches: [ "v1210" ] schedule: - cron: '0 0 * * 0' diff --git a/README.md b/README.md index b9f5829..a30eaef 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains a Go client for interacting with the PingFederate admin API. It is generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -For a client tied to a specific version, add a version qualifier matching the PingFederate version to your `require` in `go.mod`. +For a client tied to a specific version, add a version qualifier matching the PingFederate version to your `require` in `go.mod`. For example, for a client for PingFederate 11.2.5: ``` diff --git a/go.mod b/go.mod index 5027df5..6fd60d3 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/pingidentity/pingfederate-go-client/v1210 -go 1.18 +go 1.21 require golang.org/x/oauth2 v0.20.0 From 9b4e49799cbc0ddc3ab263237c094de8236d087d Mon Sep 17 00:00:00 2001 From: Henry Recker Date: Wed, 16 Oct 2024 11:10:53 -0500 Subject: [PATCH 4/5] Run go mod tidy --- go.sum | 1 + 1 file changed, 1 insertion(+) diff --git a/go.sum b/go.sum index a4711a9..29b9460 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= From 359605dbbc5af8c27ce2050b7f591d863649b09f Mon Sep 17 00:00:00 2001 From: Henry Recker Date: Wed, 16 Oct 2024 11:44:40 -0500 Subject: [PATCH 5/5] Make generate idempotent --- scripts/updateClientAndConfiguration.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/updateClientAndConfiguration.py b/scripts/updateClientAndConfiguration.py index 85d7b78..55c6970 100755 --- a/scripts/updateClientAndConfiguration.py +++ b/scripts/updateClientAndConfiguration.py @@ -15,7 +15,7 @@ line = clientFile.readline() # Use configuration.go method for UserAgent if "User-Agent" in line: - line = line.replace("c.cfg.UserAgent", "c.cfg.UserAgent()") + line = line.replace("c.cfg.UserAgent)", "c.cfg.UserAgent())") updatedClientLines.append(line) with open("client.go", 'w') as clientFile: @@ -25,6 +25,7 @@ # Update configuration.go updatedConfigurationLines = [] +userAgentMethodFound = False with open("configuration.go", 'r') as configurationFile: for line in configurationFile: # Split UserAgent into two fields in the Configuration struct @@ -35,10 +36,13 @@ # Remove UserAgent from the default configuration struct if "UserAgent:" in line: continue + if "UserAgent()" in line: + userAgentMethodFound = True updatedConfigurationLines.append(line) # Add new UserAgent() method with default that handle override and suffix -updatedConfigurationLines.append(""" +if not userAgentMethodFound: + updatedConfigurationLines.append(""" func (c *Configuration) UserAgent() string { if c.UserAgentOverride != nil { return *c.UserAgentOverride