Jonathan Turner 7 سال پیش
والد
کامیت
b080e6bb1a
4فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 4 0
      credentials/credentials.go
  2. 1 1
      pac/credentials_info.go
  3. 1 1
      pac/device_claims.go
  4. 4 1
      service/authenticator.go

+ 4 - 0
credentials/credentials.go

@@ -256,18 +256,22 @@ func (c *Credentials) Expired() bool {
 	return false
 }
 
+// Attributes returns the Credentials' attributes map.
 func (c *Credentials) Attributes() map[string]interface{} {
 	return c.attributes
 }
 
+// SetAttribute sets the value of an attribute.
 func (c *Credentials) SetAttribute(k string, v interface{}) {
 	c.attributes[k] = v
 }
 
+// SetAttributes replaces the attributes map with the one provided.
 func (c *Credentials) SetAttributes(a map[string]interface{}) {
 	c.attributes = a
 }
 
+// RemoveAttribute deletes an attribute from the attribute map that has the key provided.
 func (c *Credentials) RemoveAttribute(k string) {
 	delete(c.attributes, k)
 }

+ 1 - 1
pac/credentials_info.go

@@ -75,7 +75,7 @@ type CredentialData struct {
 	Credentials     []SECPKGSupplementalCred // Size is the value of CredentialCount
 }
 
-// ReadPACCredentialData reads a CredentialData from the byte slice.
+// Unmarshal converts the bytes provided into a CredentialData type.
 func (c *CredentialData) Unmarshal(b []byte) (err error) {
 	dec := ndr.NewDecoder(bytes.NewReader(b))
 	err = dec.Decode(c)

+ 1 - 1
pac/device_claims.go

@@ -10,7 +10,7 @@ import (
 
 // Claims reference: https://msdn.microsoft.com/en-us/library/hh553895.aspx
 
-// ClientClaimsInfo implements https://msdn.microsoft.com/en-us/library/hh536365.aspx
+// DeviceClaimsInfo implements https://msdn.microsoft.com/en-us/library/hh554226.aspx
 type DeviceClaimsInfo struct {
 	ClaimsSetMetadata mstypes.ClaimsSetMetadata
 	ClaimsSet         mstypes.ClaimsSet

+ 4 - 1
service/authenticator.go

@@ -40,7 +40,7 @@ type SPNEGOAuthenticator struct {
 // and use the value from the Principal column for the keytab entry the service should use.
 //
 // RequireHostAddr - require that the kerberos ticket must include client host IP addresses and one must match the client making the request.
-// This is controled in the client config with the noaddresses option (http://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html).
+// This is controlled in the client config with the noaddresses option (http://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html).
 //
 // DisablePACDecoding - if set to true decoding of the Microsoft PAC will be disabled.
 type Config struct {
@@ -50,15 +50,18 @@ type Config struct {
 	DisablePACDecoding bool
 }
 
+// NewSPNEGOAuthenticator creates a new SPNEGOAuthenticator.
 func NewSPNEGOAuthenticator(kt keytab.Keytab) (a SPNEGOAuthenticator) {
 	a.Config = NewConfig(kt)
 	return
 }
 
+// NewConfig creates a new kerberos service Config.
 func NewConfig(kt keytab.Keytab) *Config {
 	return &Config{Keytab: kt}
 }
 
+// Authenticate performs authentication checks against the negotiation header value provided.
 func (c *Config) Authenticate(neg, addr string) (i goidentity.Identity, ok bool, err error) {
 	a := SPNEGOAuthenticator{
 		SPNEGOHeaderValue: neg,