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

PLT-1524: Added support for password policy #145

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions api/client/v1/v1_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 133 additions & 0 deletions api/client/v1/v1_tenant_uid_password_policy_get_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions api/client/v1/v1_tenant_uid_password_policy_get_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions api/spec/palette-apis-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -27374,6 +27374,21 @@
]
},
"/v1/tenants/{tenantUid}/password/policy": {
"get": {
"tags": [
"v1"
],
"summary": "retrieves the password policy for tenant",
"operationId": "V1TenantUidPasswordPolicyGet",
"responses": {
"200": {
"description": "(empty)",
"schema": {
"$ref": "#/definitions/v1TenantPasswordPolicyEntity"
}
}
}
},
"post": {
"tags": [
"v1"
Expand Down
15 changes: 15 additions & 0 deletions api/spec/palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -27374,6 +27374,21 @@
]
},
"/v1/tenants/{tenantUid}/password/policy": {
"get": {
"tags": [
"v1"
],
"summary": "retrieves the password policy for tenant",
"operationId": "V1TenantUidPasswordPolicyGet",
"responses": {
"200": {
"description": "(empty)",
"schema": {
"$ref": "#/definitions/v1TenantPasswordPolicyEntity"
}
}
}
},
"post": {
"tags": [
"v1"
Expand Down
20 changes: 20 additions & 0 deletions client/password_policy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package client

import (
clientv1 "github.com/spectrocloud/palette-sdk-go/api/client/v1"
"github.com/spectrocloud/palette-sdk-go/api/models"
)

// UpdatePasswordPolicy updates a Password Policy.
func (h *V1Client) UpdatePasswordPolicy(tenantUID string, body *models.V1TenantPasswordPolicyEntity) error {
params := clientv1.NewV1TenantUIDPasswordPolicyUpdateParamsWithContext(h.ctx).WithTenantUID(tenantUID).WithBody(body)
_, err := h.Client.V1TenantUIDPasswordPolicyUpdate(params)
return err
}

// GetPasswordPolicy retrieves an existing password policy by tenant UID.
func (h *V1Client) GetPasswordPolicy(tenantUID string) (*models.V1TenantPasswordPolicyEntity, error) {
params := clientv1.NewV1TenantUIDPasswordPolicyGetParamsWithContext(h.ctx).WithTenantUID(tenantUID)
resp, err := h.Client.V1TenantUIDPasswordPolicyGet(params)
return resp.Payload, err
}
17 changes: 9 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/go-openapi/validate v0.24.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
)

require (
Expand All @@ -26,16 +26,17 @@ require (
github.com/go-openapi/spec v0.21.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.mongodb.org/mongo-driver v1.16.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading