service

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CreateRoleAssignmentErrorFunc = func(_ *http.Response, p1Error *model.P1Error) diag.Diagnostics {
		var diags diag.Diagnostics

		if details, ok := p1Error.GetDetailsOk(); ok && details != nil && len(details) > 0 {
			if target, ok := details[0].GetTargetOk(); ok && *target == "scope" {
				diags.AddError(
					"Incompatible role and scope combination",
					details[0].GetMessage(),
				)

				return diags
			}
		}

		return diags
	}

	RoleAssignmentRetryable = func(ctx context.Context, r *http.Response, p1error *model.P1Error) bool {

		if p1error != nil {
			var err error

			m, err := regexp.MatchString("^The actor attempting to perform the request is not authorized.", p1error.GetMessage())
			if err == nil && m {
				tflog.Warn(ctx, "Insufficient PingOne privileges detected")
				return true
			}
			if err != nil {
				tflog.Warn(ctx, "Cannot match error string for retry")
				return false
			}

			if details, ok := p1error.GetDetailsOk(); ok && details != nil && len(details) > 0 {
				m, err := regexp.MatchString("^Must have role at the same or broader scope", details[0].GetMessage())
				if err == nil && m {
					tflog.Warn(ctx, "Insufficient PingOne privileges detected")
					return true
				}
				if err != nil {
					tflog.Warn(ctx, "Cannot match error string for retry")
					return false
				}
			}

		}

		return false
	}

	RoleRemovalRetryable = func(ctx context.Context, r *http.Response, p1error *model.P1Error) bool {
		return false
	}
)
View Source
var (
	ImageTFObjectTypes = map[string]attr.Type{
		"id":   pingonetypes.ResourceIDType{},
		"href": types.StringType,
	}
)

Functions

func ExpandRoleAssignmentScope

func ExpandRoleAssignmentScope(scopeEnvironmentID, scopeOrganizationID, scopePopulationID, scopeApplicationID pingonetypes.ResourceIDValue) (scopeId, scopeType string, diags diag.Diagnostics)

func ImageListToObjectSchemaUpgrade added in v1.0.0

func ImageListToObjectSchemaUpgrade(ctx context.Context, planAttribute types.List) (types.Object, diag.Diagnostics)

func ImageOkToTF added in v0.24.0

func ImageOkToTF(logo interface{}, ok bool) (types.Object, diag.Diagnostics)

func RoleAssignmentScopeOkToTF

func RoleAssignmentScopeOkToTF(roleAssignmentScope *management.RoleAssignmentScope, ok bool) (scopeEnvironmentId, scopeOrganizationId, scopePopulationId, scopeApplicationId pingonetypes.ResourceIDValue)

func RoleAssignmentScopeSchema

func RoleAssignmentScopeSchema() map[string]schema.Attribute

Types

type ImageResourceModel added in v0.24.0

type ImageResourceModel struct {
	Id   pingonetypes.ResourceIDValue `tfsdk:"id"`
	Href types.String                 `tfsdk:"href"`
}

Directories

Path Synopsis
mfa

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL