header

package
v0.0.0-...-1a88b7f Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderXRHIDMVersion           = "X-Rh-Idm-Version"
	HeaderXRHID                   = "X-Rh-Identity"
	HeaderXRequestID              = "X-Rh-Insights-Request-Id"
	HeaderXRHIDMRegistrationToken = "X-Rh-Idm-Registration-Token"
	HeaderXRHFakeID               = "X-Rh-Fake-Identity"
	HeaderXForwardedFor           = "X-Forwarded-For"
	HeaderXPendoIntegrationKey    = "X-Pendo-Integration-Key"
)

Variables

This section is empty.

Functions

func DecodeXRHID

func DecodeXRHID(data string) (*identity.XRHID, error)

DecodeXRHID from a base64 representation and return the unmarshaled value. data is the base64 x-rh-identity header representation. Return the identity unmarshalled on success and nil, else nil and an error.

func EncodeXRHID

func EncodeXRHID(data *identity.XRHID) string

EncodeXRHID serializes the data in a base64 of the json representation. data is the Identity struct to be encoded. Return empty if the process fails, or the base64 representation of the identity.Identity provided.

func EncodeXRHIDMVersion

func EncodeXRHIDMVersion(data *XRHIDMVersion) string

EncodeXRHIDMVersion encode a base64 x-rh-idm-version header value from a XRHIDMVersion. data is the reference to the XRHIDMVersion information. Return the base64 encoded header value.

func GetPrincipal

func GetPrincipal(xrhid *identity.XRHID) string

GetPrincipal returns the principal of the identity. A principal is, based on type, User.UserID, ServiceAccount.ClientId, System.CommonName, X509.SubjectDN, Associate.RHatUUID.

Types

type XRHIDMVersion

type XRHIDMVersion struct {
	IPAHCCVersion      string `json:"ipa-hcc"`
	IPAVersion         string `json:"ipa"`
	OSReleaseID        string `json:"os-release-id"`
	OSReleaseVersionID string `json:"os-release-version-id"`
}

func NewXRHIDMVersion

func NewXRHIDMVersion(IpaHccVersion string, IpaVersion string, OSReleaseID string, OSReleaseVersionID string) *XRHIDMVersion

NewXRHIDMVersion create a new XRHIDMVersion from the arguments. IpaHccVersion is the ipa-hcc client version. IpaVersion is the rhel-idm version. OSReleaseID identifies the operating system. See: https://www.freedesktop.org/software/systemd/man/os-release.html#ID= OSReleaseVersionID identifies the operating system version. See: https://www.freedesktop.org/software/systemd/man/os-release.html#VERSION_ID= Return a filled structure or nil if something is wrong.

func NewXRHIDMVersionWithHeader

func NewXRHIDMVersionWithHeader(header string) *XRHIDMVersion

NewXRHIDMVersionWithHeader create a new XRHIDMVersion from the arguments. header is the string with the X-RH-IDM-Version content. Return a filled structure or nil if something is wrong.

Jump to

Keyboard shortcuts

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