Documentation ¶
Index ¶
- Constants
- type Client
- type KerberosConnectOptions
- type Message
- type Request
- type Response
- func (r *Response) BoolResult() bool
- func (r *Response) CountResults() int
- func (r *Response) Dict() (map[string]interface{}, bool)
- func (r *Response) DictAtIndex(index int) (map[string]interface{}, bool)
- func (r *Response) Get(key string) ([]interface{}, bool)
- func (r *Response) GetAtIndex(index int, key string) ([]interface{}, bool)
- func (r *Response) GetBool(key string) (bool, bool)
- func (r *Response) GetBoolAtIndex(index int, key string) (bool, bool)
- func (r *Response) GetData(key string) ([]byte, bool)
- func (r *Response) GetDataAtIndex(index int, key string) ([]byte, bool)
- func (r *Response) GetDatas(key string) ([][]byte, bool)
- func (r *Response) GetDatasAtIndex(index int, key string) ([][]byte, bool)
- func (r *Response) GetDateTime(key string) (time.Time, bool)
- func (r *Response) GetDateTimeAtIndex(index int, key string) (time.Time, bool)
- func (r *Response) GetDateTimes(key string) ([]time.Time, bool)
- func (r *Response) GetDateTimesAtIndex(index int, key string) ([]time.Time, bool)
- func (r *Response) GetString(key string) (string, bool)
- func (r *Response) GetStringAtIndex(index int, key string) (string, bool)
- func (r *Response) GetStrings(key string) ([]string, bool)
- func (r *Response) GetStringsAtIndex(index int, key string) ([]string, bool)
- func (r *Response) Keys() ([]string, bool)
- func (r *Response) KeysAtIndex(index int) ([]string, bool)
- type Result
Constants ¶
const ( PublicErrorCode = 900 VersionErrorCode = 901 UnknownErrorCode = 902 InternalErrorCode = 903 ServerInternalErrorCode = 904 CommandErrorCode = 905 ServerCommandErrorCode = 906 NetworkErrorCode = 907 ServerNetworkErrorCode = 908 JSONErrorCode = 909 XMLRPCMarshallErrorCode = 910 RefererErrorCode = 911 EnvironmentErrorCode = 912 SystemEncodingErrorCode = 913 AuthenticationErrorCode = 1000 KerberosErrorCode = 1100 CCacheErrorCode = 1101 ServiceErrorCode = 1102 NoCCacheErrorCode = 1103 TicketExpiredCode = 1104 BadCCachePermsCode = 1105 BadCCacheFormatCode = 1106 CannotResolveKDCCode = 1107 SessionErrorCode = 1200 InvalidSessionPasswordCode = 1201 PasswordExpiredCode = 1202 KrbPrincipalExpiredCode = 1203 UserLockedCode = 1204 AuthorizationErrorCode = 2000 ACIErrorCode = 2100 InvocationErrorCode = 3000 EncodingErrorCode = 3001 BinaryEncodingErrorCode = 3002 ZeroArgumentErrorCode = 3003 MaxArgumentErrorCode = 3004 OptionErrorCode = 3005 OverlapErrorCode = 3006 RequirementErrorCode = 3007 ConversionErrorCode = 3008 ValidationErrorCode = 3009 NoSuchNamespaceErrorCode = 3010 PasswordMismatchCode = 3011 NotImplementedErrorCode = 3012 NotConfiguredErrorCode = 3013 PromptFailedCode = 3014 DeprecationErrorCode = 3015 NotAForestRootErrorCode = 3016 ExecutionErrorCode = 4000 NotFoundCode = 4001 DuplicateEntryCode = 4002 HostServiceCode = 4003 MalformedServicePrincipalCode = 4004 RealmMismatchCode = 4005 RequiresRootCode = 4006 AlreadyPosixGroupCode = 4007 MalformedUserPrincipalCode = 4008 AlreadyActiveCode = 4009 AlreadyInactiveCode = 4010 HasNSAccountLockCode = 4011 NotGroupMemberCode = 4012 RecursiveGroupCode = 4013 AlreadyGroupMemberCode = 4014 Base64DecodeErrorCode = 4015 RemoteRetrieveErrorCode = 4016 SameGroupErrorCode = 4017 DefaultGroupErrorCode = 4018 DNSNotARecordErrorCode = 4019 ManagedGroupErrorCode = 4020 ManagedPolicyErrorCode = 4021 FileErrorCode = 4022 NoCertificateErrorCode = 4023 ManagedGroupExistsErrorCode = 4024 ReverseMemberErrorCode = 4025 AttrValueNotFoundCode = 4026 SingleMatchExpectedCode = 4027 AlreadyExternalGroupCode = 4028 ExternalGroupViolationCode = 4029 PosixGroupViolationCode = 4030 EmptyResultCode = 4031 InvalidDomainLevelErrorCode = 4032 ServerRemovalErrorCode = 4033 OperationNotSupportedForPrincipalTypeCode = 4034 HTTPRequestErrorCode = 4035 RedundantMappingRuleCode = 4036 CSRTemplateErrorCode = 4037 AlreadyContainsValueErrorCode = 4038 BuiltinErrorCode = 4100 HelpErrorCode = 4101 LDAPErrorCode = 4200 MidairCollisionCode = 4201 EmptyModlistCode = 4202 DatabaseErrorCode = 4203 LimitsExceededCode = 4204 ObjectclassViolationCode = 4205 NotAllowedOnRDNCode = 4206 OnlyOneValueAllowedCode = 4207 InvalidSyntaxCode = 4208 BadSearchFilterCode = 4209 NotAllowedOnNonLeafCode = 4210 DatabaseTimeoutCode = 4211 DNSDataMismatchCode = 4212 TaskTimeoutCode = 4213 TimeLimitExceededCode = 4214 SizeLimitExceededCode = 4215 AdminLimitExceededCode = 4216 CertificateErrorCode = 4300 CertificateOperationErrorCode = 4301 CertificateFormatErrorCode = 4302 MutuallyExclusiveErrorCode = 4303 NonFatalErrorCode = 4304 AlreadyRegisteredErrorCode = 4305 NotRegisteredErrorCode = 4306 DependentEntryCode = 4307 LastMemberErrorCode = 4308 ProtectedEntryErrorCode = 4309 CertificateInvalidErrorCode = 4310 SchemaUpToDateCode = 4311 DNSErrorCode = 4400 DNSResolverErrorCode = 4401 TrustErrorCode = 4500 TrustTopologyConflictErrorCode = 4501 GenericErrorCode = 5000 )
Standard FreeIPA error codes.
const LDAPGeneralizedTimeFormat = "20060102150405Z"
General date/time format in LDAP. https://github.com/freeipa/freeipa/blob/ipa-4-7/ipalib/constants.py#L271
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The base object for connections to FreeIPA API.
func ConnectWithKerberos ¶
func ConnectWithKerberos(host string, transport *http.Transport, options *KerberosConnectOptions) (*Client, error)
Create a new client using Kerberos authentication.
type KerberosConnectOptions ¶
type KerberosConnectOptions struct { Krb5ConfigReader io.Reader KeytabReader io.Reader User string Realm string }
Options for connecting to Kerberos.
type Message ¶
type Message struct { Type string `json:"type"` Message string `json:"message"` Code int `json:"code"` Name string `json:"name"` }
Used in providing extra messages and error response.
type Request ¶
type Request struct { Method string `json:"method"` Params []interface{} `json:"params"` }
Request format.
func NewRequest ¶
Create a new API request.
type Response ¶
type Response struct { Error *Message `json:"error"` Result *Result `json:"result"` Version string `json:"version"` Principal string `json:"principal"` }
Standard response from FreeIPA.
func ParseResponse ¶
Parse response from reader.
func (*Response) BoolResult ¶
Decode results which are boolean formatted, usually used to indicate success or state.
func (*Response) CountResults ¶
Count the number of results that this request has.
func (*Response) DictAtIndex ¶
Return dictionary at index.
func (*Response) GetAtIndex ¶
Get an interface for a key.
func (*Response) GetBoolAtIndex ¶
Get a boolean from a key at an index.
func (*Response) GetDataAtIndex ¶
Get byte array for key at an index.
func (*Response) GetDatasAtIndex ¶
Get byte array for key at an index.
func (*Response) GetDateTime ¶
Get date time value for key.
func (*Response) GetDateTimeAtIndex ¶
Get date time value for key at an index.
func (*Response) GetDateTimes ¶
Get date time value for key.
func (*Response) GetDateTimesAtIndex ¶
Get date time value for key at an index.
func (*Response) GetStringAtIndex ¶
Get string value for key at an index.
func (*Response) GetStrings ¶
Get string value for key.
func (*Response) GetStringsAtIndex ¶
Get string value for key at an index.
type Result ¶
type Result struct { Count int `json:"count"` Truncated bool `json:"truncated"` Messages []*Message `json:"messages,omitempty"` // This result differs depending on response, // read the API documentation below for information. // https://github.com/freeipa/freeipa/tree/master/doc/api Result interface{} `json:"result"` Summary string `json:"summary,omitempty"` Value string `json:"value,omitempty"` }
Standard result in response from FreeIPA.