validation

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Overview

Copyright 2022 IBM Corp.

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.

Copyright 2022 IBM Corp.

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.

Index

Constants

This section is empty.

Variables

View Source
var (
	Base64Re = regexp.MustCompile(`^((?:[A-Za-z\d+/]{4})*(?:[A-Za-z\d+/]{3}=|[A-Za-z\d+/]{2}==)?)$`)
	TokenRe  = regexp.MustCompile(`^hyper-protect-basic\.((?:[A-Za-z\d+/]{4})*(?:[A-Za-z\d+/]{3}=|[A-Za-z\d+/]{2}==)?)\.((?:[A-Za-z\d+/]{4})*(?:[A-Za-z\d+/]{3}=|[A-Za-z\d+/]{2}==)?)$`)
)

Functions

func DiagCertificate

func DiagCertificate(data any, _ cty.Path) diag.Diagnostics

DiagCertificate validates that the given certificate is indeed a certificate

func DiagContract

func DiagContract(data any, _ cty.Path) diag.Diagnostics

DiagContract validates that the given certificate is indeed a certificate

func DiagCsrFile added in v0.5.0

func DiagCsrFile(data interface{}, path cty.Path) diag.Diagnostics

func DiagCsrParams added in v0.5.0

func DiagCsrParams(data interface{}, path cty.Path) diag.Diagnostics

DiagCsrParams validates that paramters for CSR are present in the data

func DiagFolder

func DiagFolder(data any, _ cty.Path) diag.Diagnostics

DiagFolder validates that the given path points to an existing folder

func DiagPrivateKey added in v0.1.6

func DiagPrivateKey(data any, _ cty.Path) diag.Diagnostics

DiagPrivateKey validates that the given private key is indeed a private key

func GetContractSchema

func GetContractSchema() E.Either[error, *jsonschema.Schema]

GetContractSchema reads the json schema from a string representation into a schema representation

func ValidateYAML

func ValidateYAML[A any](validator func(A) []jsonschema.KeyError) func(data string) E.Either[error, A]

ValidateYAML validates a YAML file against the validator function by deserializing it, then validate the result

Types

type RawMap

type RawMap = map[string]any

Jump to

Keyboard shortcuts

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