fix(02-03): mask OAuth client_id and unix issued_at
RFC 7591 registration returns a string client_id and unix client_id_issued_at; treating those as Carbon/integer foreign keys would fail PHP self-replay of MCP OAuth. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -55,16 +55,19 @@ func maskLeaf(path string, val any, step Step, diffs *[]Diff) any {
|
||||
if key == "slug" || disabledPath(step, path, key) {
|
||||
return val
|
||||
}
|
||||
if key == "collection_key" {
|
||||
if key == "collection_key" || key == "client_id" {
|
||||
if val == nil {
|
||||
return nil
|
||||
}
|
||||
if _, ok := val.(string); !ok {
|
||||
*diffs = append(*diffs, Diff{Path: path, Expected: "string collection_key", Actual: formatValue(val)})
|
||||
*diffs = append(*diffs, Diff{Path: path, Expected: "string " + key, Actual: formatValue(val)})
|
||||
return val
|
||||
}
|
||||
return maskID
|
||||
}
|
||||
if strings.HasSuffix(key, "_issued_at") {
|
||||
return maskIDValue(path, val, diffs)
|
||||
}
|
||||
if isDateKey(key) {
|
||||
return maskDate(path, val, diffs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user