chore(oss): audit the server package and resync the SDK mirrors
Split the 657-line operation service into eor, submit, and verify modules, add the AGENT_REVOKED and KEY_RETIRED codes the Backend already emits, and condense every multi-line comment. Mirror Node, Python, and Go at 2.1.0 with the deep-health 503, non-idempotent retry, rotation grace, and path-encoding fixes. Document which routes and response fields the self-hosted server does not provide. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
2010175a82
commit
bc6983a62e
364 files changed
+10180
-23349
No files matched your search
@@ -17,15 +17,6 @@ type jsoncEditor struct {
|
||||
label string
|
||||
}
|
||||
|
||||
func standardizeJSONC(source []byte, label string, allowTrailingCommas bool) ([]byte, error) {
|
||||
value, err := parseJSONC(source, label, allowTrailingCommas)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
value.Standardize()
|
||||
return value.Pack(), nil
|
||||
}
|
||||
|
||||
func parseJSONC(source []byte, label string, allowTrailingCommas bool) (hujson.Value, error) {
|
||||
value, err := hujson.Parse(source)
|
||||
if err != nil {
|
||||
@@ -97,6 +88,16 @@ func rejectDuplicateJSONCKeys(value *hujson.Value, label, location string) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func decodeStrictJSONObject(source []byte, label string) (map[string]any, error) {
|
||||
if !json.Valid(source) {
|
||||
var value any
|
||||
if err := json.Unmarshal(source, &value); err != nil {
|
||||
return nil, fmt.Errorf("parse %s: %w", label, err)
|
||||
}
|
||||
}
|
||||
return decodeJSONCObject(source, label, false)
|
||||
}
|
||||
|
||||
func decodeJSONCObject(source []byte, label string, allowTrailingCommas bool) (map[string]any, error) {
|
||||
value, err := parseJSONC(source, label, allowTrailingCommas)
|
||||
if err != nil {
|
||||
@@ -292,3 +293,11 @@ func jsonPointer(path []any) string {
|
||||
}
|
||||
return pointer.String()
|
||||
}
|
||||
|
||||
func cloneJSONObject(value map[string]any) map[string]any {
|
||||
clone := make(map[string]any, len(value))
|
||||
for key, item := range value {
|
||||
clone[key] = item
|
||||
}
|
||||
return clone
|
||||
}
|
||||
Reference in new issue
Block a user