feat(credentials): Refactor credential purposes (#2260)
* feat(credentials): Refactor credential purposes * Application credentials have been refactored to Brokered credentials * Egress credentials have been refactored to Injected Application credentials Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
This commit is contained in:
1 parent
271cc8f781
commit
a17e973712
49 files changed
+1516
-1051
No files matched your search
+24
-12
@@ -111,6 +111,18 @@ func DefaultAttributes() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithBrokeredCredentialSourceIds(inBrokeredCredentialSourceIds []string) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["brokered_credential_source_ids"] = inBrokeredCredentialSourceIds
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultBrokeredCredentialSourceIds() Option {
|
||||
return func(o *options) {
|
||||
o.postMap["brokered_credential_source_ids"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithTcpTargetDefaultPort(inDefaultPort uint32) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
@@ -147,24 +159,24 @@ func DefaultDescription() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithEgressCredentialSourceIds(inEgressCredentialSourceIds []string) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["egress_credential_source_ids"] = inEgressCredentialSourceIds
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultEgressCredentialSourceIds() Option {
|
||||
return func(o *options) {
|
||||
o.postMap["egress_credential_source_ids"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithHostId(inHostId string) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["host_id"] = inHostId
|
||||
}
|
||||
}
|
||||
|
||||
func WithInjectedApplicationCredentialSourceIds(inInjectedApplicationCredentialSourceIds []string) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["injected_application_credential_source_ids"] = inInjectedApplicationCredentialSourceIds
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultInjectedApplicationCredentialSourceIds() Option {
|
||||
return func(o *options) {
|
||||
o.postMap["injected_application_credential_source_ids"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithName(inName string) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["name"] = inName
|
||||
|
||||
+24
-22
@@ -13,28 +13,30 @@ import (
|
||||
)
|
||||
|
||||
type Target struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
ScopeId string `json:"scope_id,omitempty"`
|
||||
Scope *scopes.ScopeInfo `json:"scope,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
CreatedTime time.Time `json:"created_time,omitempty"`
|
||||
UpdatedTime time.Time `json:"updated_time,omitempty"`
|
||||
Version uint32 `json:"version,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
HostSetIds []string `json:"host_set_ids,omitempty"`
|
||||
HostSets []*HostSet `json:"host_sets,omitempty"`
|
||||
HostSourceIds []string `json:"host_source_ids,omitempty"`
|
||||
HostSources []*HostSource `json:"host_sources,omitempty"`
|
||||
SessionMaxSeconds uint32 `json:"session_max_seconds,omitempty"`
|
||||
SessionConnectionLimit int32 `json:"session_connection_limit,omitempty"`
|
||||
WorkerFilter string `json:"worker_filter,omitempty"`
|
||||
ApplicationCredentialSourceIds []string `json:"application_credential_source_ids,omitempty"`
|
||||
ApplicationCredentialSources []*CredentialSource `json:"application_credential_sources,omitempty"`
|
||||
EgressCredentialSourceIds []string `json:"egress_credential_source_ids,omitempty"`
|
||||
EgressCredentialSources []*CredentialSource `json:"egress_credential_sources,omitempty"`
|
||||
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
||||
AuthorizedActions []string `json:"authorized_actions,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
ScopeId string `json:"scope_id,omitempty"`
|
||||
Scope *scopes.ScopeInfo `json:"scope,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
CreatedTime time.Time `json:"created_time,omitempty"`
|
||||
UpdatedTime time.Time `json:"updated_time,omitempty"`
|
||||
Version uint32 `json:"version,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
HostSetIds []string `json:"host_set_ids,omitempty"`
|
||||
HostSets []*HostSet `json:"host_sets,omitempty"`
|
||||
HostSourceIds []string `json:"host_source_ids,omitempty"`
|
||||
HostSources []*HostSource `json:"host_sources,omitempty"`
|
||||
SessionMaxSeconds uint32 `json:"session_max_seconds,omitempty"`
|
||||
SessionConnectionLimit int32 `json:"session_connection_limit,omitempty"`
|
||||
WorkerFilter string `json:"worker_filter,omitempty"`
|
||||
ApplicationCredentialSourceIds []string `json:"application_credential_source_ids,omitempty"`
|
||||
ApplicationCredentialSources []*CredentialSource `json:"application_credential_sources,omitempty"`
|
||||
BrokeredCredentialSourceIds []string `json:"brokered_credential_source_ids,omitempty"`
|
||||
BrokeredCredentialSources []*CredentialSource `json:"brokered_credential_sources,omitempty"`
|
||||
InjectedApplicationCredentialSourceIds []string `json:"injected_application_credential_source_ids,omitempty"`
|
||||
InjectedApplicationCredentialSources []*CredentialSource `json:"injected_application_credential_sources,omitempty"`
|
||||
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
||||
AuthorizedActions []string `json:"authorized_actions,omitempty"`
|
||||
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user