jwt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServiceFromFile

func ServiceFromFile(ctx context.Context, fn string, tc auth.TokenCache) (*salesforce.Service, error)

ServiceFromFile uses the passed file to create a Service

func ServiceFromJSON

func ServiceFromJSON(ctx context.Context, buff []byte, tc auth.TokenCache) (*salesforce.Service, error)

ServiceFromJSON uses the passed byte array to create a Service

func ServiceFromReader

func ServiceFromReader(ctx context.Context, rdr io.Reader, tc auth.TokenCache) (*salesforce.Service, error)

ServiceFromReader uses the passed file to create a Service

Types

type Config

type Config struct {
	Host          string `json:"host,omitempty"`           /// salesforce host for instance
	ConsumerKey   string `json:"consumer_key,omitempty"`   // sf consumer key for application
	IsTest        bool   `json:"is_test,omitempty"`        // set to yes if using sandox
	UserID        string `json:"user_id,omitempty"`        // salesforce login for user impersonation
	Key           string `json:"key,omitempty"`            // private key pem
	KeyID         string `json:"keyid,omitempty"`          // optional
	APIVersion    string `json:"version,omitempty"`        // vXX.X, leave blank for salesforce default
	TokenDuration int    `json:"tokenDuration,omitempty"`  // in minutes
	CacheFile     string `json:"file_cache_loc,omitempty"` // path of file for use with a filecache.

	ClientFunc ctxclient.Func `json:"-"` // used for testing
}

Config contains sufficient info for JWT Login

func (*Config) Service

func (c *Config) Service(ctx context.Context, tc auth.TokenCache) (*salesforce.Service, error)

Service returns api service authorizing api calls via jwt token gen

type FileCache

type FileCache = auth.FileCache

FileCache uses filesystem to cache tokens in a predetermined file

Jump to

Keyboard shortcuts

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