feat(simnet): add SimNet protocol end-to-end support

- model: SimNet protocol fields + NormalizeSimnet; type+port protocol uniqueness
- server config: OmnXT runtime config delivery via compatible() simnet case
- credentials: derive per-user psk/key_id from subscription (pkg/simnet), no new table
- subscription: adapter buildOmnxtSimnetConfigs + base64 buildOmnxtProtocolLinks + OmnXT SimNet application (migration 02161)
- UA gating: hide experimental protocols from non first-party clients (download + JSON node-list)
- admin: normalize simnet on create/update and on GET responses
- tests: 21 simnet unit tests; full suite green
This commit is contained in:
2026-07-27 00:17:02 -07:00
parent 5ef3f2717e
commit 634b5a7bd0
23 changed files with 1728 additions and 107 deletions
@@ -83,6 +83,8 @@ func (l *CreateServerLogic) CreateServer(req *types.CreateServerRequest) error {
}
}
}
// Simnet: apply defaults / normalize (no-op for other protocols)
protocol.NormalizeSimnet()
protocols = append(protocols, protocol)
}
@@ -54,6 +54,10 @@ func (l *FilterServerListLogic) FilterServerList(req *types.FilterServerListRequ
l.Errorf("[FilterServerList] UnmarshalProtocols Error: %s", err.Error())
continue
}
// Normalize simnet defaults on the response (safe: dst is a fresh slice).
for i := range dst {
dst[i].NormalizeSimnet()
}
tool.DeepCopy(&protocols, dst)
server.Protocols = protocols
@@ -41,6 +41,12 @@ func (l *GetServerProtocolsLogic) GetServerProtocols(req *types.GetServerProtoco
l.Errorf("[FilterServerList] UnmarshalProtocols Error: %s", err.Error())
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DatabaseQueryError), "[FilterServerList] UnmarshalProtocols Error: %s", err.Error())
}
// Normalize simnet defaults on the response so the admin UI always sees a
// consistent config even for legacy/hand-inserted rows. dst is a fresh slice
// (not shared with the DB), so mutating it here is safe.
for i := range dst {
dst[i].NormalizeSimnet()
}
tool.DeepCopy(&protocols, dst)
return &types.GetServerProtocolsResponse{
@@ -100,6 +100,8 @@ func (l *UpdateServerLogic) UpdateServer(req *types.UpdateServerRequest) error {
}
}
}
// Simnet: apply defaults / normalize (no-op for other protocols)
protocol.NormalizeSimnet()
protocols = append(protocols, protocol)
}
err = data.MarshalProtocols(protocols)