Skip to content

Commit

Permalink
Merge pull request #173 from okta/upgrade-openapi-spec-2.1.0
Browse files Browse the repository at this point in the history
Upgradet to okta openapi spec tp 2.1.1
  • Loading branch information
bogdanprodan-okta authored Oct 23, 2020
2 parents fe09919 + 90e60d4 commit aa17cd7
Show file tree
Hide file tree
Showing 30 changed files with 622 additions and 420 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor
.okta
.idea
.okta.yaml
26 changes: 26 additions & 0 deletions okta/acsEndpoint.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import ()

type AcsEndpoint struct {
Index int64 `json:"index,omitempty"`
Url string `json:"url,omitempty"`
}
38 changes: 38 additions & 0 deletions okta/catalogApplication.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import (
"time"
)

type CatalogApplication struct {
Links interface{} `json:"_links,omitempty"`
Category string `json:"category,omitempty"`
Description string `json:"description,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Features []string `json:"features,omitempty"`
Id string `json:"id,omitempty"`
LastUpdated *time.Time `json:"lastUpdated,omitempty"`
Name string `json:"name,omitempty"`
SignOnModes []string `json:"signOnModes,omitempty"`
Status string `json:"status,omitempty"`
VerificationStatus string `json:"verificationStatus,omitempty"`
Website string `json:"website,omitempty"`
}
23 changes: 23 additions & 0 deletions okta/catalogApplicationStatus.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import ()

type CatalogApplicationStatus string
47 changes: 47 additions & 0 deletions okta/customHotpUserFactor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import (
"time"
)

type CustomHotpUserFactor struct {
Embedded interface{} `json:"_embedded,omitempty"`
Links interface{} `json:"_links,omitempty"`
Created *time.Time `json:"created,omitempty"`
FactorType string `json:"factorType,omitempty"`
Id string `json:"id,omitempty"`
LastUpdated *time.Time `json:"lastUpdated,omitempty"`
Provider string `json:"provider,omitempty"`
Status string `json:"status,omitempty"`
Verify *VerifyFactorRequest `json:"verify,omitempty"`
FactorProfileId string `json:"factorProfileId,omitempty"`
Profile *CustomHotpUserFactorProfile `json:"profile,omitempty"`
}

func NewCustomHotpUserFactor() *CustomHotpUserFactor {
return &CustomHotpUserFactor{
FactorType: "hotp",
}
}

func (a *CustomHotpUserFactor) IsUserFactorInstance() bool {
return true
}
33 changes: 33 additions & 0 deletions okta/customHotpUserFactorProfile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import ()

type CustomHotpUserFactorProfile struct {
SharedSecret string `json:"sharedSecret,omitempty"`
}

func NewCustomHotpUserFactorProfile() *CustomHotpUserFactorProfile {
return &CustomHotpUserFactorProfile{}
}

func (a *CustomHotpUserFactorProfile) IsUserFactorInstance() bool {
return true
}
13 changes: 4 additions & 9 deletions okta/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (m *GroupResource) GetRole(ctx context.Context, groupId string, roleId stri
}

// Lists all App targets for an `APP_ADMIN` Role assigned to a Group. This methods return list may include full Applications or Instances. The response for an instance will have an `ID` value, while Application will not have an ID.
func (m *GroupResource) ListApplicationTargetsForApplicationAdministratorRoleForGroup(ctx context.Context, groupId string, roleId string, qp *query.Params) ([]App, *Response, error) {
func (m *GroupResource) ListApplicationTargetsForApplicationAdministratorRoleForGroup(ctx context.Context, groupId string, roleId string, qp *query.Params) ([]*CatalogApplication, *Response, error) {
url := fmt.Sprintf("/api/v1/groups/%v/roles/%v/targets/catalog/apps", groupId, roleId)
if qp != nil {
url = url + qp.String()
Expand All @@ -385,19 +385,14 @@ func (m *GroupResource) ListApplicationTargetsForApplicationAdministratorRoleFor
return nil, nil, err
}

var application []Application
var catalogApplication []*CatalogApplication

resp, err := m.client.requestExecutor.Do(ctx, req, &application)
resp, err := m.client.requestExecutor.Do(ctx, req, &catalogApplication)
if err != nil {
return nil, resp, err
}

apps := make([]App, len(application))
for i := range application {
apps[i] = &application[i]
}
return apps, resp, nil

return catalogApplication, resp, nil
}

func (m *GroupResource) RemoveApplicationTargetFromApplicationAdministratorRoleGivenToGroup(ctx context.Context, groupId string, roleId string, appName string) (*Response, error) {
Expand Down
23 changes: 23 additions & 0 deletions okta/inlineHookStatus.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import ()

type InlineHookStatus string
23 changes: 23 additions & 0 deletions okta/inlineHookType.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2018 - Present Okta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY

package okta

import ()

type InlineHookType string
2 changes: 1 addition & 1 deletion okta/jsonWebKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type JsonWebKey struct {
Alg string `json:"alg,omitempty"`
Created *time.Time `json:"created,omitempty"`
E string `json:"e,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
KeyOps []string `json:"key_ops,omitempty"`
Kid string `json:"kid,omitempty"`
Kty string `json:"kty,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions okta/oAuth2ScopeConsentGrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ type OAuth2ScopeConsentGrant struct {
ScopeId string `json:"scopeId,omitempty"`
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
UserId string `json:"userId,omitempty"`
}
10 changes: 5 additions & 5 deletions okta/passwordCredentialHash.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ package okta
import ()

type PasswordCredentialHash struct {
Algorithm string `json:"algorithm,omitempty"`
Salt string `json:"salt,omitempty"`
SaltOrder string `json:"saltOrder,omitempty"`
Value string `json:"value,omitempty"`
WorkerFactor int64 `json:"workerFactor,omitempty"`
Algorithm string `json:"algorithm,omitempty"`
Salt string `json:"salt,omitempty"`
SaltOrder string `json:"saltOrder,omitempty"`
Value string `json:"value,omitempty"`
WorkFactor int64 `json:"workFactor,omitempty"`
}
16 changes: 8 additions & 8 deletions okta/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type Params struct {
DisableNotifications string `json:"disableNotifications,omitempty"`
Type string `json:"type,omitempty"`
TargetIdpId string `json:"targetIdpId,omitempty"`
Until string `json:"until,omitempty"`
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
SortOrder string `json:"sortOrder,omitempty"`
Status string `json:"status,omitempty"`
TemplateType string `json:"templateType,omitempty"`
Expand Down Expand Up @@ -160,14 +160,14 @@ func WithTargetIdpId(queryTargetIdpId string) ParamOptions {
p.TargetIdpId = queryTargetIdpId
}
}
func WithUntil(queryUntil string) ParamOptions {
func WithSince(querySince string) ParamOptions {
return func(p *Params) {
p.Until = queryUntil
p.Since = querySince
}
}
func WithSince(querySince string) ParamOptions {
func WithUntil(queryUntil string) ParamOptions {
return func(p *Params) {
p.Since = querySince
p.Until = queryUntil
}
}
func WithSortOrder(querySortOrder string) ParamOptions {
Expand Down Expand Up @@ -293,12 +293,12 @@ func (p *Params) String() string {
if p.TargetIdpId != "" {
qs.Add(`targetIdpId`, p.TargetIdpId)
}
if p.Until != "" {
qs.Add(`until`, p.Until)
}
if p.Since != "" {
qs.Add(`since`, p.Since)
}
if p.Until != "" {
qs.Add(`until`, p.Until)
}
if p.SortOrder != "" {
qs.Add(`sortOrder`, p.SortOrder)
}
Expand Down
3 changes: 3 additions & 0 deletions okta/requestExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ func (re *RequestExecutor) NewRequest(method string, url string, body interface{
priv := []byte(strings.ReplaceAll(re.config.Okta.Client.PrivateKey, `\n`, "\n"))

privPem, _ := pem.Decode(priv)
if privPem == nil {
return nil, errors.New("invalid private key")
}
if privPem.Type != "RSA PRIVATE KEY" {
return nil, fmt.Errorf("RSA private key is of the wrong type")
}
Expand Down
44 changes: 23 additions & 21 deletions okta/samlApplicationSettingsSignOn.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,29 @@ package okta
import ()

type SamlApplicationSettingsSignOn struct {
AssertionSigned *bool `json:"assertionSigned,omitempty"`
AttributeStatements []*SamlAttributeStatement `json:"attributeStatements,omitempty"`
Audience string `json:"audience,omitempty"`
AudienceOverride string `json:"audienceOverride,omitempty"`
AuthnContextClassRef string `json:"authnContextClassRef,omitempty"`
DefaultRelayState string `json:"defaultRelayState,omitempty"`
Destination string `json:"destination,omitempty"`
DestinationOverride string `json:"destinationOverride,omitempty"`
DigestAlgorithm string `json:"digestAlgorithm,omitempty"`
HonorForceAuthn *bool `json:"honorForceAuthn,omitempty"`
IdpIssuer string `json:"idpIssuer,omitempty"`
Recipient string `json:"recipient,omitempty"`
RecipientOverride string `json:"recipientOverride,omitempty"`
RequestCompressed *bool `json:"requestCompressed,omitempty"`
ResponseSigned *bool `json:"responseSigned,omitempty"`
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"`
SpIssuer string `json:"spIssuer,omitempty"`
SsoAcsUrl string `json:"ssoAcsUrl,omitempty"`
SsoAcsUrlOverride string `json:"ssoAcsUrlOverride,omitempty"`
SubjectNameIdFormat string `json:"subjectNameIdFormat,omitempty"`
SubjectNameIdTemplate string `json:"subjectNameIdTemplate,omitempty"`
AcsEndpoints []*AcsEndpoint `json:"acsEndpoints,omitempty"`
AllowMultipleAcsEndpoints *bool `json:"allowMultipleAcsEndpoints,omitempty"`
AssertionSigned *bool `json:"assertionSigned,omitempty"`
AttributeStatements []*SamlAttributeStatement `json:"attributeStatements,omitempty"`
Audience string `json:"audience,omitempty"`
AudienceOverride string `json:"audienceOverride,omitempty"`
AuthnContextClassRef string `json:"authnContextClassRef,omitempty"`
DefaultRelayState string `json:"defaultRelayState,omitempty"`
Destination string `json:"destination,omitempty"`
DestinationOverride string `json:"destinationOverride,omitempty"`
DigestAlgorithm string `json:"digestAlgorithm,omitempty"`
HonorForceAuthn *bool `json:"honorForceAuthn,omitempty"`
IdpIssuer string `json:"idpIssuer,omitempty"`
Recipient string `json:"recipient,omitempty"`
RecipientOverride string `json:"recipientOverride,omitempty"`
RequestCompressed *bool `json:"requestCompressed,omitempty"`
ResponseSigned *bool `json:"responseSigned,omitempty"`
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"`
SpIssuer string `json:"spIssuer,omitempty"`
SsoAcsUrl string `json:"ssoAcsUrl,omitempty"`
SsoAcsUrlOverride string `json:"ssoAcsUrlOverride,omitempty"`
SubjectNameIdFormat string `json:"subjectNameIdFormat,omitempty"`
SubjectNameIdTemplate string `json:"subjectNameIdTemplate,omitempty"`
}

func NewSamlApplicationSettingsSignOn() *SamlApplicationSettingsSignOn {
Expand Down
Loading

0 comments on commit aa17cd7

Please sign in to comment.