Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Set User-Agent header in API client #40

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: Set User-Agent header in API client
bvargasre committed Aug 6, 2024
commit bf29809c2884f1f54ba85ef15e634e2d3ff6a964
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,10 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.4] - 2024-08-06
### Added
- Set User-Agent header in API client

## [1.3.3] - 2024-05-15
### Fixed
- Added missing parameters in Children structs at `network_access_authorization_rules`

## [1.3.2] - 2024-05-15
### Fixed
- Update NetworkDeviceGroup API parameter name from `ndgtpye` to `othername`in 3.3 patch 1.
@@ -242,4 +246,6 @@ Following parameters were added to `RequestNetworkAccessAuthenticationRulesCreat
[1.3.0]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.2.0...v1.3.0
[1.3.1]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.0...v1.3.1
[1.3.2]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.1...v1.3.2
[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.3.2...main
[1.3.3]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.2...v1.3.3
[1.3.4]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.3.3...v1.3.4
[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.3.4...main
4 changes: 4 additions & 0 deletions sdk/api_client.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@ const ISE_DEBUG = "ISE_DEBUG"
const ISE_SSL_VERIFY = "ISE_SSL_VERIFY"
const ISE_USE_API_GATEWAY = "ISE_USE_API_GATEWAY"
const ISE_USE_CSRF_TOKEN = "ISE_USE_CSRF_TOKEN"
const VERSION = "3.3_patch_1"
const USER_AGENT = "go-cisco-ise/" + VERSION

const emptyStringToJSONError = "unexpected end of JSON input"

@@ -239,6 +241,7 @@ var Error map[string]interface{}
func NewClient() (*Client, error) {
var err error
client := resty.New()
client.SetHeader("User-Agent", USER_AGENT)
c := &Client{}
c.common.client = client
username := ""
@@ -461,5 +464,6 @@ func NewClientWithOptions(baseURL string, username string, password string, debu

// RestyClient returns the resty.Client used by the sdk
func (s *Client) RestyClient() *resty.Client {
s.common.client.SetHeader("User-Agent", USER_AGENT)
return s.common.client
}