Documentation ¶
Overview ¶
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 ¶
- Variables
- func GetKeySha256(jwtLicense string) (string, error)
- type Entitlement
- func (*Entitlement) Descriptor() ([]byte, []int)deprecated
- func (x *Entitlement) GetEnd() *timestamppb.Timestamp
- func (x *Entitlement) GetLimit() int64
- func (x *Entitlement) GetMeasure() string
- func (x *Entitlement) GetName() string
- func (x *Entitlement) GetStart() *timestamppb.Timestamp
- func (*Entitlement) ProtoMessage()
- func (x *Entitlement) ProtoReflect() protoreflect.Message
- func (x *Entitlement) Reset()
- func (x *Entitlement) String() string
- type License
- func (*License) Descriptor() ([]byte, []int)deprecated
- func (x *License) GetCustomer() string
- func (x *License) GetCustomerId() string
- func (x *License) GetCustomerIdVersion() string
- func (x *License) GetEntitlements() []*Entitlement
- func (x *License) GetGenerationDate() *timestamppb.Timestamp
- func (x *License) GetGenerator() string
- func (x *License) GetId() string
- func (x *License) GetKeySha256() string
- func (x *License) GetType() string
- func (x *License) GetVersion() string
- func (l *License) PrettyPrint() string
- func (*License) ProtoMessage()
- func (x *License) ProtoReflect() protoreflect.Message
- func (x *License) Reset()
- func (x *License) String() string
- type ParsedLicense
Constants ¶
This section is empty.
Variables ¶
var File_lib_license_license_proto protoreflect.FileDescriptor
Functions ¶
func GetKeySha256 ¶
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,proto3" json:"name,omitempty"` // ReticulateSplines Measure string `protobuf:"bytes,2,opt,name=measure,proto3" json:"measure,omitempty"` // nodes Limit int64 `protobuf:"zigzag64,3,opt,name=limit,proto3" json:"limit,omitempty"` // 10 Start *timestamppb.Timestamp `protobuf:"bytes,22,opt,name=start,proto3" json:"start,omitempty"` // date the entitlement becomes active End *timestamppb.Timestamp `protobuf:"bytes,23,opt,name=end,proto3" json:"end,omitempty"` // last date the entitlement is active // contains filtered or unexported fields }
func (*Entitlement) Descriptor
deprecated
func (*Entitlement) Descriptor() ([]byte, []int)
Deprecated: Use Entitlement.ProtoReflect.Descriptor instead.
func (*Entitlement) GetEnd ¶
func (x *Entitlement) GetEnd() *timestamppb.Timestamp
func (*Entitlement) GetLimit ¶
func (x *Entitlement) GetLimit() int64
func (*Entitlement) GetMeasure ¶
func (x *Entitlement) GetMeasure() string
func (*Entitlement) GetName ¶
func (x *Entitlement) GetName() string
func (*Entitlement) GetStart ¶
func (x *Entitlement) GetStart() *timestamppb.Timestamp
func (*Entitlement) ProtoMessage ¶
func (*Entitlement) ProtoMessage()
func (*Entitlement) ProtoReflect ¶
func (x *Entitlement) ProtoReflect() protoreflect.Message
func (*Entitlement) Reset ¶
func (x *Entitlement) Reset()
func (*Entitlement) String ¶
func (x *Entitlement) String() string
type License ¶
type License struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique ID for this license; defaults to auto-generated Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // License version Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // commercial, eval, developer, partner Generator string `protobuf:"bytes,20,opt,name=generator,proto3" json:"generator,omitempty"` // chef/license, chef/license-generation-service KeySha256 string `protobuf:"bytes,6,opt,name=key_sha256,json=keySha256,proto3" json:"key_sha256,omitempty"` // public key checksum GenerationDate *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=generation_date,json=generationDate,proto3" json:"generation_date,omitempty"` Customer string `protobuf:"bytes,24,opt,name=customer,proto3" json:"customer,omitempty"` CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` CustomerIdVersion string `protobuf:"bytes,25,opt,name=customer_id_version,json=customerIdVersion,proto3" json:"customer_id_version,omitempty"` Entitlements []*Entitlement `protobuf:"bytes,5,rep,name=entitlements,proto3" json:"entitlements,omitempty"` // contains filtered or unexported fields }
func Read ¶
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
deprecated
func (*License) GetCustomer ¶
func (*License) GetCustomerId ¶
func (*License) GetCustomerIdVersion ¶
func (*License) GetEntitlements ¶
func (x *License) GetEntitlements() []*Entitlement
func (*License) GetGenerationDate ¶
func (x *License) GetGenerationDate() *timestamppb.Timestamp
func (*License) GetGenerator ¶
func (*License) GetKeySha256 ¶
func (*License) GetVersion ¶
func (*License) PrettyPrint ¶
PrettyPrint a license into a nice string for text output
func (*License) ProtoMessage ¶
func (*License) ProtoMessage()
func (*License) ProtoReflect ¶
func (x *License) ProtoReflect() protoreflect.Message
type ParsedLicense ¶
type ParsedLicense struct { Id string `json:"id,omitempty"` // Unique ID for this license; defaults to auto-generated Version string `json:"version,omitempty"` // License version Type string `json:"type,omitempty"` // commercial, eval, developer, partner Generator string `json:"generator,omitempty"` // chef/license, chef/license-generation-service KeySha256 string `json:"key_sha256,omitempty"` // public key checksum GenerationDate *timestamppb.Timestamp `json:"generation_date,omitempty"` Customer string `json:"customer,omitempty"` V0CustomerId string `json:"customer_id,omitempty"` V1CustomerId string `json:"customerId,omitempty"` CustomerIdVersion string `json:"customer_id_version,omitempty"` Entitlements []*Entitlement `json:"entitlements,omitempty"` }