apppush

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package apppush stores app APNs certificates separately from MDM credentials.

Design

Store validates a certificate and its private key before replacing the credential for a topic. Each replacement increments a persistent version. PushCertificate reloads the credential for each send, so server replicas see committed renewals without restarting. Administrative listings expose only metadata.

Persistent state backends must supply an encryption keyring. Encrypted records are bound to their storage keys so they cannot be moved between topics.

References

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Topic     string    `json:"Topic"`
	NotBefore time.Time `json:"NotBefore"`
	NotAfter  time.Time `json:"NotAfter"`
	Version   int64     `json:"Version"`
}

Metadata is safe to return through the admin API; it never contains a key.

type Store

type Store struct {
	State state.Store
	Keys  *crypt.Keyring
	Now   func() time.Time
}

Store uses the server's transactional state backend. Persistent backends must supply Keys. Memory may omit it. The record key is authenticated as AAD.

func (*Store) List

func (s *Store) List(ctx context.Context, after string, limit int) ([]Metadata, string, error)

List returns metadata in topic order, with an opaque next cursor.

func (*Store) PushCertificate

func (s *Store) PushCertificate(ctx context.Context, topic string) (tls.Certificate, error)

PushCertificate reloads on every send, so replicas see committed renewals.

func (*Store) Put

func (s *Store) Put(ctx context.Context, topic string, cert, privateKey []byte) (Metadata, error)

Put validates before replacing a credential, incrementing its version atomically.

Jump to

Keyboard shortcuts

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