-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from CiscoISE/develop
New version 3.3 patch 1
- Loading branch information
Showing
35 changed files
with
5,892 additions
and
1,419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.