oficina / home Public

Clone
git clone https://amadan.net/oficina/home

Plain git — no account needed to clone.

Download

Download this file

1//go:build linux
2
3package operator
4
5import "amadan.net/carlos/platform.git/launchctx/controlname"
6
7type schemaCommandConfigV2 struct {
8 commandConfig
9 SchemaProfile string `json:"schema_profile"`
10 SchemaManifestDigest string `json:"schema_manifest_digest"`
11}
12
13func parseSchemaCommandConfigV2(raw []byte) (schemaCommandConfigV2, *schemaVerifierV2, error) {
14 var c schemaCommandConfigV2
15 if len(raw) == 0 || len(raw) > 8192 || strict(raw, &c) != nil || c.Version != 2 || !controlname.ValidAccount(c.Account) || !controlname.ValidApp(c.App) || !controlname.ValidHostShape(c.Host) {
16 return schemaCommandConfigV2{}, nil, ErrRefused
17 }
18 v, err := newSchemaVerifierV2(Pins{c.Role, c.Origin, c.Installation, c.Registry, c.Device, c.PublicKey, c.Actions}, c.SchemaProfile, c.SchemaManifestDigest)
19 if err != nil || c.KeyID != v.base.kid {
20 return schemaCommandConfigV2{}, nil, ErrRefused
21 }
22 return c, v, nil
23}
24