license

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package license is a generated protocol buffer package.

It is generated from these files:

license.proto

It has these top-level messages:

License
Entitlement

package license provides functions for reading and printing licenses generated by Chef's license generation service.

WARNING WARNING WARNING WARNING WARNING

The code in this package is a copy of code in the chef/license library. chef/license is still proprietary and thus cannot be included in full as a dependency. Please take care that any changes to this file are compatible with the chef/license library.

WARNING WARNING WARNING WARNING WARNING

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeySha256

func GetKeySha256(jwtLicense string) (string, error)

GetKeySha256 fetches the SHA256 of the public key from the JWT encoded license

Types

type Entitlement

type Entitlement struct {
	Name    string                     `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Measure string                     `protobuf:"bytes,2,opt,name=measure" json:"measure,omitempty"`
	Limit   int64                      `protobuf:"zigzag64,3,opt,name=limit" json:"limit,omitempty"`
	Start   *google_protobuf.Timestamp `protobuf:"bytes,22,opt,name=start" json:"start,omitempty"`
	End     *google_protobuf.Timestamp `protobuf:"bytes,23,opt,name=end" json:"end,omitempty"`
}

func (*Entitlement) Descriptor

func (*Entitlement) Descriptor() ([]byte, []int)

func (*Entitlement) GetEnd

func (m *Entitlement) GetEnd() *google_protobuf.Timestamp

func (*Entitlement) GetLimit

func (m *Entitlement) GetLimit() int64

func (*Entitlement) GetMeasure

func (m *Entitlement) GetMeasure() string

func (*Entitlement) GetName

func (m *Entitlement) GetName() string

func (*Entitlement) GetStart

func (m *Entitlement) GetStart() *google_protobuf.Timestamp

func (*Entitlement) ProtoMessage

func (*Entitlement) ProtoMessage()

func (*Entitlement) Reset

func (m *Entitlement) Reset()

func (*Entitlement) String

func (m *Entitlement) String() string

type License

type License struct {
	Id                string                     `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Version           string                     `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
	Type              string                     `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"`
	Generator         string                     `protobuf:"bytes,20,opt,name=generator" json:"generator,omitempty"`
	KeySha256         string                     `protobuf:"bytes,6,opt,name=key_sha256,json=keySha256" json:"key_sha256,omitempty"`
	GenerationDate    *google_protobuf.Timestamp `protobuf:"bytes,21,opt,name=generation_date,json=generationDate" json:"generation_date,omitempty"`
	Customer          string                     `protobuf:"bytes,24,opt,name=customer" json:"customer,omitempty"`
	CustomerId        string                     `protobuf:"bytes,4,opt,name=customer_id,json=customerId" json:"customer_id,omitempty"`
	CustomerIdVersion string                     `protobuf:"bytes,25,opt,name=customer_id_version,json=customerIdVersion" json:"customer_id_version,omitempty"`
	Entitlements      []*Entitlement             `protobuf:"bytes,5,rep,name=entitlements" json:"entitlements,omitempty"`
}

func Read

func Read(license string, publicKey []byte) (*License, error)

Read and parse a license from a string and return the config Ex: sha, _ := license.GetKeySha256(license)

lic, _ := license.Read(license, publicKeys[sha])

func (*License) Descriptor

func (*License) Descriptor() ([]byte, []int)

func (*License) GetCustomer

func (m *License) GetCustomer() string

func (*License) GetCustomerId

func (m *License) GetCustomerId() string

func (*License) GetCustomerIdVersion

func (m *License) GetCustomerIdVersion() string

func (*License) GetEntitlements

func (m *License) GetEntitlements() []*Entitlement

func (*License) GetGenerationDate

func (m *License) GetGenerationDate() *google_protobuf.Timestamp

func (*License) GetGenerator

func (m *License) GetGenerator() string

func (*License) GetId

func (m *License) GetId() string

func (*License) GetKeySha256

func (m *License) GetKeySha256() string

func (*License) GetType

func (m *License) GetType() string

func (*License) GetVersion

func (m *License) GetVersion() string

func (*License) PrettyPrint

func (l *License) PrettyPrint() string

PrettyPrint a license into a nice string for text output

func (*License) ProtoMessage

func (*License) ProtoMessage()

func (*License) Reset

func (m *License) Reset()

func (*License) String

func (m *License) String() string

Jump to

Keyboard shortcuts

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