github.com/infraboard/keyauth@v0.8.1/client/auth.go (about)

     1  package client
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/infraboard/keyauth/common/header"
     7  )
     8  
     9  // Authentication todo
    10  type Authentication struct {
    11  	clientID     string
    12  	clientSecret string
    13  }
    14  
    15  // SetClientCredentials todo
    16  func (a *Authentication) SetClientCredentials(clientID, clientSecret string) {
    17  	a.clientID = clientID
    18  	a.clientSecret = clientSecret
    19  }
    20  
    21  // GetRequestMetadata todo
    22  func (a *Authentication) GetRequestMetadata(context.Context, ...string) (
    23  	map[string]string, error,
    24  ) {
    25  	return map[string]string{
    26  		header.ClientHeaderKey: a.clientID,
    27  		header.ClientSecretKey: a.clientSecret,
    28  	}, nil
    29  }
    30  
    31  // RequireTransportSecurity todo
    32  func (a *Authentication) RequireTransportSecurity() bool {
    33  	return false
    34  }