webpush

package
v0.0.0-...-109c5d9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_webpush_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type MessageData

type MessageData struct {

	// Time when the message was sent, according to the sender clock.
	Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
	// Original ID. If missing, the envelope ID will be used.
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Original destination
	To    string            `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`
	From  string            `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
	Topic string            `protobuf:"bytes,5,opt,name=topic,proto3" json:"topic,omitempty"`
	Meta  map[string]string `` /* 149-byte string literal not displayed */
	Data  []byte            `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

Common fields to be encoded in the 'data' proto

func (*MessageData) Descriptor deprecated

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

Deprecated: Use MessageData.ProtoReflect.Descriptor instead.

func (*MessageData) GetData

func (x *MessageData) GetData() []byte

func (*MessageData) GetFrom

func (x *MessageData) GetFrom() string

func (*MessageData) GetId

func (x *MessageData) GetId() string

func (*MessageData) GetMeta

func (x *MessageData) GetMeta() map[string]string

func (*MessageData) GetTime

func (x *MessageData) GetTime() int64

func (*MessageData) GetTo

func (x *MessageData) GetTo() string

func (*MessageData) GetTopic

func (x *MessageData) GetTopic() string

func (*MessageData) ProtoMessage

func (*MessageData) ProtoMessage()

func (*MessageData) ProtoReflect

func (x *MessageData) ProtoReflect() protoreflect.Message

func (*MessageData) Reset

func (x *MessageData) Reset()

func (*MessageData) String

func (x *MessageData) String() string

type PushRequest

type PushRequest struct {

	// The value returned in the SubscribeResponse push, without the hostname.
	Push string `protobuf:"bytes,1,opt,name=push,proto3" json:"push,omitempty"`
	Ttl  int32  `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// aes128gcm encrypted
	Data    []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Urgency string `protobuf:"bytes,4,opt,name=urgency,proto3" json:"urgency,omitempty"`
	// Prefer header indicating delivery receipt request.
	RespondAsync bool   `protobuf:"varint,5,opt,name=respond_async,json=respondAsync,proto3" json:"respond_async,omitempty"`
	Topic        string `protobuf:"bytes,6,opt,name=topic,proto3" json:"topic,omitempty"`
	// contains filtered or unexported fields
}

func (*PushRequest) Descriptor deprecated

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

Deprecated: Use PushRequest.ProtoReflect.Descriptor instead.

func (*PushRequest) GetData

func (x *PushRequest) GetData() []byte

func (*PushRequest) GetPush

func (x *PushRequest) GetPush() string

func (*PushRequest) GetRespondAsync

func (x *PushRequest) GetRespondAsync() bool

func (*PushRequest) GetTopic

func (x *PushRequest) GetTopic() string

func (*PushRequest) GetTtl

func (x *PushRequest) GetTtl() int32

func (*PushRequest) GetUrgency

func (x *PushRequest) GetUrgency() string

func (*PushRequest) ProtoMessage

func (*PushRequest) ProtoMessage()

func (*PushRequest) ProtoReflect

func (x *PushRequest) ProtoReflect() protoreflect.Message

func (*PushRequest) Reset

func (x *PushRequest) Reset()

func (*PushRequest) String

func (x *PushRequest) String() string

type PushResponse

type PushResponse struct {
	MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// If request includes the respond_async parameter.
	//
	PushReceipt string `protobuf:"bytes,2,opt,name=push_receipt,json=pushReceipt,proto3" json:"push_receipt,omitempty"`
	// contains filtered or unexported fields
}

func (*PushResponse) Descriptor deprecated

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

Deprecated: Use PushResponse.ProtoReflect.Descriptor instead.

func (*PushResponse) GetMessageId

func (x *PushResponse) GetMessageId() string

func (*PushResponse) GetPushReceipt

func (x *PushResponse) GetPushReceipt() string

func (*PushResponse) ProtoMessage

func (*PushResponse) ProtoMessage()

func (*PushResponse) ProtoReflect

func (x *PushResponse) ProtoReflect() protoreflect.Message

func (*PushResponse) Reset

func (x *PushResponse) Reset()

func (*PushResponse) String

func (x *PushResponse) String() string

type Vapid

type Vapid struct {

	// json payload of VAPID ( without base64 encoding)
	// Can also be a proto message when used over other transports.
	// Verification requires converting back to base64 !
	// Decoded to reduce the binary size
	Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
	// Public key of the signer, 64 bytes, EC256, decoded.
	// Included in 'k' parameter for HTTP.
	K []byte `protobuf:"bytes,4,opt,name=k,proto3" json:"k,omitempty"`
	// If empty, it is assumed to be the constant value {typ=JWT,alg=ES256}
	TType []byte `protobuf:"bytes,32,opt,name=t_type,json=tType,proto3" json:"t_type,omitempty"`
	// Decoded
	TSignature []byte `protobuf:"bytes,33,opt,name=t_signature,json=tSignature,proto3" json:"t_signature,omitempty"`
	// contains filtered or unexported fields
}

Vapid is the proto variant of a Webpush JWT. This is a more compact representation, without base64 overhead

For HTTP, included in Authorization header: Authorization: vapid t=B64url k=B64url

Decoded t is of form: { "typ": "JWT", "alg": "ES256" }.JWT.SIG

{ "crv":"P-256",

"kty":"EC",
"x":"DUfHPKLVFQzVvnCPGyfucbECzPDa7rWbXriLcysAjEc",
"y":"F6YK5h4SDYic-dRuU_RCPCfA5aq9ojSwk5Y2EmClBPs" }

func (*Vapid) Descriptor deprecated

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

Deprecated: Use Vapid.ProtoReflect.Descriptor instead.

func (*Vapid) GetData

func (x *Vapid) GetData() []byte

func (*Vapid) GetK

func (x *Vapid) GetK() []byte

func (*Vapid) GetTSignature

func (x *Vapid) GetTSignature() []byte

func (*Vapid) GetTType

func (x *Vapid) GetTType() []byte

func (*Vapid) ProtoMessage

func (*Vapid) ProtoMessage()

func (*Vapid) ProtoReflect

func (x *Vapid) ProtoReflect() protoreflect.Message

func (*Vapid) Reset

func (x *Vapid) Reset()

func (*Vapid) String

func (x *Vapid) String() string

type Via

type Via struct {
	Time int64  `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
	Vip  string `protobuf:"bytes,2,opt,name=vip,proto3" json:"vip,omitempty"`
	// contains filtered or unexported fields
}

func (*Via) Descriptor deprecated

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

Deprecated: Use Via.ProtoReflect.Descriptor instead.

func (*Via) GetTime

func (x *Via) GetTime() int64

func (*Via) GetVip

func (x *Via) GetVip() string

func (*Via) ProtoMessage

func (*Via) ProtoMessage()

func (*Via) ProtoReflect

func (x *Via) ProtoReflect() protoreflect.Message

func (*Via) Reset

func (x *Via) Reset()

func (*Via) String

func (x *Via) String() string

type WebpushMessage

type WebpushMessage struct {

	// Unique in context of the origin
	// For webpush, generated by the original server (from subscription), as Location:
	// Example: https://push.example.net/message/qDIYHNcfAIPP_5ITvURr-d6BGt
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Plaintext = 0
	// aes128gcm = 1
	ContentEncoding int32 `protobuf:"varint,7,opt,name=content_encoding,json=contentEncoding,proto3" json:"content_encoding,omitempty"`
	// If encoding is "1" - aes128gcm
	// Otherwise it is a plaintext message.
	Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// Message path
	Path []*Via `protobuf:"bytes,6,rep,name=path,proto3" json:"path,omitempty"`
	Ttl  int32  `protobuf:"varint,9,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// Maps to the SubscribeResponse push parameter, returned as Link rel="urn:ietf:params:push"
	// in the push promise.
	Push string `protobuf:"bytes,2,opt,name=push,proto3" json:"push,omitempty"`
	// Identifies the sender - compact form.
	Sender *Vapid `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"`
	// URL or IPv6, extracted from the VAPID of the sender or other
	// form of authentication.
	From string `protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"`
	// contains filtered or unexported fields
}

Message is returned as PUSH PROMISE frames in the spec. The alternative protocol wraps it in Any field or other framing.

func (*WebpushMessage) Descriptor deprecated

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

Deprecated: Use WebpushMessage.ProtoReflect.Descriptor instead.

func (*WebpushMessage) GetContentEncoding

func (x *WebpushMessage) GetContentEncoding() int32

func (*WebpushMessage) GetData

func (x *WebpushMessage) GetData() []byte

func (*WebpushMessage) GetFrom

func (x *WebpushMessage) GetFrom() string

func (*WebpushMessage) GetId

func (x *WebpushMessage) GetId() string

func (*WebpushMessage) GetPath

func (x *WebpushMessage) GetPath() []*Via

func (*WebpushMessage) GetPush

func (x *WebpushMessage) GetPush() string

func (*WebpushMessage) GetSender

func (x *WebpushMessage) GetSender() *Vapid

func (*WebpushMessage) GetTtl

func (x *WebpushMessage) GetTtl() int32

func (*WebpushMessage) ProtoMessage

func (*WebpushMessage) ProtoMessage()

func (*WebpushMessage) ProtoReflect

func (x *WebpushMessage) ProtoReflect() protoreflect.Message

func (*WebpushMessage) Reset

func (x *WebpushMessage) Reset()

func (*WebpushMessage) String

func (x *WebpushMessage) String() string

Jump to

Keyboard shortcuts

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