-
Notifications
You must be signed in to change notification settings - Fork 2
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 #30 from Keyfactor/enrollment_timeout_fix
Enrollment timeout fix
- Loading branch information
Showing
12 changed files
with
285 additions
and
7 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
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
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,7 @@ | ||
package api | ||
|
||
const ( | ||
MAX_ITERATIONS = 100000 | ||
MAX_WAIT_SECONDS = 30 | ||
MAX_CONTEXT_DEADLINE_RETRIES = 5 | ||
) |
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,55 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
) | ||
|
||
func (c *Client) ListPendingCertificates(q map[string]string) ([]WorkflowCertificate, error) { | ||
return c.ListWorkflowCert("Pending") | ||
} | ||
|
||
func (c *Client) ListDeniedCertificates(q map[string]string) ([]WorkflowCertificate, error) { | ||
return c.ListWorkflowCert("Denied") | ||
} | ||
|
||
func (c *Client) ListExternalValidationPendingCertificates(q map[string]string) ([]WorkflowCertificate, error) { | ||
return c.ListWorkflowCert("ExternalValidation") | ||
} | ||
|
||
func (c *Client) ListWorkflowCert(endpoint string) ([]WorkflowCertificate, error) { | ||
// Set Keyfactor-specific headers | ||
headers := &apiHeaders{ | ||
Headers: []StringTuple{ | ||
{"x-keyfactor-api-version", "1"}, | ||
{"x-keyfactor-requested-with", "APIClient"}, | ||
}, | ||
} | ||
query := apiQuery{ | ||
Query: []StringTuple{}, | ||
} | ||
query.Query = append(query.Query, StringTuple{ | ||
"pagedQuery.returnLimit", "1000", | ||
}) | ||
|
||
keyfactorAPIStruct := &request{ | ||
Method: "GET", | ||
Endpoint: fmt.Sprintf("Workflow/Certificates/%s", endpoint), | ||
Headers: headers, | ||
Query: &query, | ||
Payload: nil, | ||
} | ||
|
||
resp, err := c.sendRequest(keyfactorAPIStruct) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
var jsonResp []WorkflowCertificate | ||
err = json.NewDecoder(resp.Body).Decode(&jsonResp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return jsonResp, err | ||
|
||
} |
Oops, something went wrong.