service

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CreateRoleAssignmentErrorFunc = func(error model.P1Error) diag.Diagnostics {
		var diags diag.Diagnostics

		if details, ok := error.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 nil
	}

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

		if p1error != nil {
			var err error

			if m, err := regexp.MatchString("^The actor attempting to perform the request is not authorized.", p1error.GetMessage()); 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 {
				if m, err := regexp.MatchString("^Must have role at the same or broader scope", details[0].GetMessage()); 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
	}
)
View Source
var (
	ImageTFObjectTypes = map[string]attr.Type{
		"id":   types.StringType,
		"href": types.StringType,
	}
)

Functions

func ExpandRoleAssignmentScope

func ExpandRoleAssignmentScope(scopeEnvironmentID, scopeOrganizationID, scopePopulationID basetypes.StringValue) (string, string, diag.Diagnostics)

func ImageOkToTF added in v0.24.0

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

func RoleAssignmentScopeSchema

func RoleAssignmentScopeSchema() map[string]schema.Attribute

Types

type ImageResourceModel added in v0.24.0

type ImageResourceModel struct {
	Id   types.String `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