code: func NewAuthHandlerFromSigner(signer signer.Signer) (http.Handler, error) {
  	policy := signer.Policy()
  	if policy == nil {
  		return nil, errors.New(errors.PolicyError, errors.InvalidPolicy)
  	}
  
  	if policy.Default == nil && policy.Profiles == nil {
  		return nil, errors.New(errors.PolicyError, errors.InvalidPolicy)
  	}
  
  	// AuthSign will not respond for profiles that have no auth provider.
  	// So if there are no profiles with auth providers in this policy,
  	// we return an error.
  	haveAuth := (policy.Default.Provider != nil)
  	for _, profile := range policy.Profiles {
  		if haveAuth {
  			break
  		}
  		haveAuth = (profile.Provider != nil)
  	}
  
  	if !haveAuth {
  		return nil, errors.New(errors.PolicyError, errors.InvalidPolicy)
  	}
  
  	return &api.HTTPHandler{
  		Handler: &AuthHandler{
  			signer: signer,
  		},
  		Methods: []string{"POST"},
  	}, nil
  }
docs: // NewAuthHandlerFromSigner creates a new AuthHandler from the signer
  // that is passed in.