Skip to content

Commit

Permalink
Merge pull request #35 from CiscoISE/develop
Browse files Browse the repository at this point in the history
New version 3.3 patch 1
  • Loading branch information
bvargasre authored Apr 24, 2024
2 parents 7ec2245 + af10595 commit 4bd379c
Show file tree
Hide file tree
Showing 35 changed files with 5,892 additions and 1,419 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.0] - 2024-04-24
### Added
- `ciscoise-go-sdk` now supports ISE 3.3 patch 1 API.
- New services included: `active_directories, ad_groups, custom_attributes, duo_identity_sync, duo_mfa, enable_mfa, endpoint_stop_replication_service, endpoints, full_upgrade, is_mfa_enabled, native_ipsec, px_grid_direct, sgt_range_reservation, user_equipment`

## [1.2.0] - 2023-11-07
### Added
- `ciscoise-go-sdk` now supports ISE 3.2-Beta API.
Expand Down Expand Up @@ -222,4 +227,5 @@ Following parameters were added to `RequestNetworkAccessAuthenticationRulesCreat
[1.1.21]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.20...v1.1.21
[1.1.22]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.21...v1.1.22
[1.2.0]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.1.22...v1.2.0
[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.2.0...main
[1.3.0]: https://github.com/CiscoISE/ciscoise-go-sdk/compare/v1.2.0...v1.3.0
[Unreleased]: https://github.com/cisco-en-programmability/ciscoise-go-sdk/compare/v1.3.0...main
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ https://pkg.go.dev/github.com/CiscoISE/ciscoise-go-sdk
|--------------|-----------------------------|
| 0.y.z | 3.1.0 |
| 1.0.z | 3.1.0 |
| 1.1.z | 3.1_Patch_1 |
| 1.2.z | 3.2-Beta |
| 1.1.z | 3.1 Patch 1 |
| 1.2.z | 3.2 Beta |
| 1.3.z | 3.3 patch 1 |

## Changelog

Expand Down
49 changes: 49 additions & 0 deletions sdk/active_directories.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package isegosdk

import (
"fmt"

"github.com/go-resty/resty/v2"
)

type ActiveDirectoriesService service

type ResponseActiveDirectoriesGetActiveDirectories []ResponseItemActiveDirectoriesGetActiveDirectories // Array of ResponseActiveDirectoriesGetActiveDirectories

type ResponseItemActiveDirectoriesGetActiveDirectories struct {
DirectoryID string `json:"directoryID,omitempty"` // Active Directory ID
Domain string `json:"domain,omitempty"` // Active Directory domain name
Name string `json:"name,omitempty"` // Name of the Active Directory
}

//GetActiveDirectories Get the list of all configured Active Directories
/* Duo-IdentitySync Get the list of all configured Active Directories
*/
func (s *ActiveDirectoriesService) GetActiveDirectories() (*ResponseActiveDirectoriesGetActiveDirectories, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/duo-identitysync/activedirectories"

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseActiveDirectoriesGetActiveDirectories{}).
SetError(&Error).
Get(path)

if err != nil {
return nil, nil, err

}

if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetActiveDirectories")
}

getCSFRToken(response.Header())

result := response.Result().(*ResponseActiveDirectoriesGetActiveDirectories)
return result, response, err

}
51 changes: 51 additions & 0 deletions sdk/ad_groups.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package isegosdk

import (
"fmt"
"strings"

"github.com/go-resty/resty/v2"
)

type ADGroupsService service

type ResponseADGroupsGetAdgroups []ResponseItemADGroupsGetAdgroups // Array of ResponseADGroupsGetAdgroups

type ResponseItemADGroupsGetAdgroups struct {
Name string `json:"name,omitempty"` // Active Directory Group ID
Source string `json:"source,omitempty"` // Source of the Active Directory Group
}

//GetAdgroups Get the list of all AD groups for the specified Active Directory
/* Duo-IdentitySync Get the list of all AD groups for the specified Active Directory
@param activeDirectory activeDirectory path parameter. List of AD groups for the specified Active Directory
*/
func (s *ADGroupsService) GetAdgroups(activeDirectory string) (*ResponseADGroupsGetAdgroups, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/duo-identitysync/adgroups/{activeDirectory}"
path = strings.Replace(path, "{activeDirectory}", fmt.Sprintf("%v", activeDirectory), -1)

setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseADGroupsGetAdgroups{}).
SetError(&Error).
Get(path)

if err != nil {
return nil, nil, err

}

if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetAdgroups")
}

getCSFRToken(response.Header())

result := response.Result().(*ResponseADGroupsGetAdgroups)
return result, response, err

}
43 changes: 41 additions & 2 deletions sdk/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ type Client struct {
// API Services
AciBindings *AciBindingsService
AciSettings *AciSettingsService
ADGroups *ADGroupsService
AncEndpoint *AncEndpointService
ActiveDirectories *ActiveDirectoriesService
ActiveDirectory *ActiveDirectoryService
AdminUser *AdminUserService
AllowedProtocols *AllowedProtocolsService
Expand Down Expand Up @@ -72,8 +74,10 @@ type Client struct {
DeviceAdministrationServiceNames *DeviceAdministrationServiceNamesService
DeviceAdministrationTimeDateConditions *DeviceAdministrationTimeDateConditionsService
DownloadableACL *DownloadableACLService
Edda *EddaService
DuoIDentitySync *DuoIDentitySyncService
DuoMfa *DuoMfaService
EgressMatrixCell *EgressMatrixCellService
EndpointStopReplicationService *EndpointStopReplicationServiceService
EndpointCertificate *EndpointCertificateService
EndpointIDentityGroup *EndpointIDentityGroupService
ExternalRadiusServer *ExternalRadiusServerService
Expand All @@ -93,6 +97,7 @@ type Client struct {
Mdm *MdmService
Misc *MiscService
MyDevicePortal *MyDevicePortalService
NativeIPsec *NativeIPsecService
NativeSupplicantProfile *NativeSupplicantProfileService
NetworkAccessAuthenticationRules *NetworkAccessAuthenticationRulesService
NetworkAccessAuthorizationExceptionRules *NetworkAccessAuthorizationExceptionRulesService
Expand Down Expand Up @@ -138,6 +143,7 @@ type Client struct {
SecurityGroupsACLs *SecurityGroupsACLsService
SelfRegisteredPortal *SelfRegisteredPortalService
SessionDirectory *SessionDirectoryService
SgtRangeReservation *SgtRangeReservationService
SponsorGroup *SponsorGroupService
SponsorGroupMember *SponsorGroupMemberService
SponsorPortal *SponsorPortalService
Expand All @@ -155,14 +161,25 @@ type Client struct {
TelemetryInformation *TelemetryInformationService
TrustSecConfiguration *TrustSecConfigurationService
TrustSecSxp *TrustSecSxpService
UserEquipment *UserEquipmentService
VersionAndPatch *VersionAndPatchService
VersionInfo *VersionInfoService
CustomAttributes *CustomAttributesService
EnableMFA *EnableMFAService
Endpoint *EndpointService
Endpoints *EndpointsService
FullUpgrade *FullUpgradeService
IsMFAEnabled *IsMFAEnabledService
NbarApp *NbarAppService
Portal *PortalService
Proxy *ProxyService
PxGridDirect *PxGridDirectService
PxGridNode *PxGridNodeService
SgVnMapping *SgVnMappingService
Tasks *TasksService
Telemetry *TelemetryService
VirtualNetwork *VirtualNetworkService
VnVLANMapping *VnVLANMappingService
}

type service struct {
Expand Down Expand Up @@ -208,6 +225,9 @@ func getPort(group string) string {
if group == "_px_grid" {
return ":8910"
}
if group == "_px_grid_direct" {
return ":44330"
}
return ""
}

Expand Down Expand Up @@ -263,7 +283,9 @@ func NewClient() (*Client, error) {
}
c.AciBindings = (*AciBindingsService)(&c.common)
c.AciSettings = (*AciSettingsService)(&c.common)
c.ADGroups = (*ADGroupsService)(&c.common)
c.AncEndpoint = (*AncEndpointService)(&c.common)
c.ActiveDirectories = (*ActiveDirectoriesService)(&c.common)
c.ActiveDirectory = (*ActiveDirectoryService)(&c.common)
c.AdminUser = (*AdminUserService)(&c.common)
c.AllowedProtocols = (*AllowedProtocolsService)(&c.common)
Expand Down Expand Up @@ -292,8 +314,10 @@ func NewClient() (*Client, error) {
c.DeviceAdministrationServiceNames = (*DeviceAdministrationServiceNamesService)(&c.common)
c.DeviceAdministrationTimeDateConditions = (*DeviceAdministrationTimeDateConditionsService)(&c.common)
c.DownloadableACL = (*DownloadableACLService)(&c.common)
c.Edda = (*EddaService)(&c.common)
c.DuoIDentitySync = (*DuoIDentitySyncService)(&c.common)
c.DuoMfa = (*DuoMfaService)(&c.common)
c.EgressMatrixCell = (*EgressMatrixCellService)(&c.common)
c.EndpointStopReplicationService = (*EndpointStopReplicationServiceService)(&c.common)
c.EndpointCertificate = (*EndpointCertificateService)(&c.common)
c.EndpointIDentityGroup = (*EndpointIDentityGroupService)(&c.common)
c.ExternalRadiusServer = (*ExternalRadiusServerService)(&c.common)
Expand All @@ -313,6 +337,7 @@ func NewClient() (*Client, error) {
c.Mdm = (*MdmService)(&c.common)
c.Misc = (*MiscService)(&c.common)
c.MyDevicePortal = (*MyDevicePortalService)(&c.common)
c.NativeIPsec = (*NativeIPsecService)(&c.common)
c.NativeSupplicantProfile = (*NativeSupplicantProfileService)(&c.common)
c.NetworkAccessAuthenticationRules = (*NetworkAccessAuthenticationRulesService)(&c.common)
c.NetworkAccessAuthorizationExceptionRules = (*NetworkAccessAuthorizationExceptionRulesService)(&c.common)
Expand Down Expand Up @@ -358,6 +383,7 @@ func NewClient() (*Client, error) {
c.SecurityGroupsACLs = (*SecurityGroupsACLsService)(&c.common)
c.SelfRegisteredPortal = (*SelfRegisteredPortalService)(&c.common)
c.SessionDirectory = (*SessionDirectoryService)(&c.common)
c.SgtRangeReservation = (*SgtRangeReservationService)(&c.common)
c.SponsorGroup = (*SponsorGroupService)(&c.common)
c.SponsorGroupMember = (*SponsorGroupMemberService)(&c.common)
c.SponsorPortal = (*SponsorPortalService)(&c.common)
Expand All @@ -375,12 +401,25 @@ func NewClient() (*Client, error) {
c.TelemetryInformation = (*TelemetryInformationService)(&c.common)
c.TrustSecConfiguration = (*TrustSecConfigurationService)(&c.common)
c.TrustSecSxp = (*TrustSecSxpService)(&c.common)
c.UserEquipment = (*UserEquipmentService)(&c.common)
c.VersionAndPatch = (*VersionAndPatchService)(&c.common)
c.VersionInfo = (*VersionInfoService)(&c.common)
c.CustomAttributes = (*CustomAttributesService)(&c.common)
c.EnableMFA = (*EnableMFAService)(&c.common)
c.Endpoint = (*EndpointService)(&c.common)
c.Endpoints = (*EndpointsService)(&c.common)
c.FullUpgrade = (*FullUpgradeService)(&c.common)
c.IsMFAEnabled = (*IsMFAEnabledService)(&c.common)
c.NbarApp = (*NbarAppService)(&c.common)
c.Portal = (*PortalService)(&c.common)
c.Proxy = (*ProxyService)(&c.common)
c.PxGridDirect = (*PxGridDirectService)(&c.common)
c.PxGridNode = (*PxGridNodeService)(&c.common)
c.SgVnMapping = (*SgVnMappingService)(&c.common)
c.Tasks = (*TasksService)(&c.common)
c.Telemetry = (*TelemetryService)(&c.common)
c.VirtualNetwork = (*VirtualNetworkService)(&c.common)
c.VnVLANMapping = (*VnVLANMappingService)(&c.common)

client.SetBasicAuth(username, password)
return c, nil
Expand Down
Loading

0 comments on commit 4bd379c

Please sign in to comment.