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 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 8ab0cde..a30eaef 100644 --- a/README.md +++ b/README.md @@ -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. 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 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= 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