utils

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

utilities.go For utility/helper functions to support the jamf pro package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64EncodeCertificate

func Base64EncodeCertificate(certPath string) (string, error)

func ConvertFromXMLSafeString added in v0.0.78

func ConvertFromXMLSafeString(s string) string

ConvertFromXMLSafeString reverses the process of ConvertToXMLSafeString. It replaces XML entity references in a string back to their original characters. This is useful when reading XML data that contains entity references and converting them back to normal characters.

func ConvertToXMLSafeString added in v0.0.78

func ConvertToXMLSafeString(s string) string

ConvertToXMLSafeString replaces disallowed XML characters in a string with their corresponding XML entity references. This function is useful for preparing a string to be safely included in an XML document.

func EnsureXMLSafeString added in v0.0.78

func EnsureXMLSafeString(s string) string

EnsureXMLSafeString checks if a string contains disallowed XML characters. If it does, it converts the string to an XML-safe format using ConvertToXMLSafeString. This function is useful for ensuring that strings are safe for inclusion in XML documents.

Types

type ConfigurationProfile added in v1.0.10

type ConfigurationProfile struct {
	PayloadContent     []PayloadContentListItem
	PayloadDisplayName string
	PayloadIdentifier  string
	PayloadType        string
	PayloadUuid        string
	PayloadVersion     int
	UnexpectedValues   map[string]interface{} `mapstructure:",remain"`
}

Struct to mirror MacOS .plist conifguration profile data with bucket for unexpected values

func ConfigurationFilePlistToStructFromFile added in v1.0.10

func ConfigurationFilePlistToStructFromFile(filepath string) (*ConfigurationProfile, error)

ConfigurationFilePlistToStruct takes filepath of MacOS Configuration Profile .plist file and returns &ConfigurationProfile

func ConfigurationProfilePlistToStructFromString added in v1.0.10

func ConfigurationProfilePlistToStructFromString(plistData string) (*ConfigurationProfile, error)

ConfigurationProfilePlistToStructFromString takes xml of MacOS Configuration Profile .plist file and returns &ConfigurationProfile

type PayloadContentListItem added in v1.0.10

type PayloadContentListItem struct {
	PayloadDisplayName    string
	PayloadIdentifier     string
	PayloadType           string
	PayloadUuid           string
	PayloadVersion        int
	PayloadSpecificValues map[string]interface{} `mapstructure:",remain"`
}

Struct to mirror xml payload item with key for all dynamic values

Jump to

Keyboard shortcuts

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