Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch with spec on casing #406

Closed
3 tasks done
John-LittleBearLabs opened this issue Apr 14, 2023 · 2 comments
Closed
3 tasks done

Mismatch with spec on casing #406

John-LittleBearLabs opened this issue Apr 14, 2023 · 2 comments
Labels
dif/easy Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up

Comments

@John-LittleBearLabs
Copy link
Contributor

John-LittleBearLabs commented Apr 14, 2023

Checklist

Installation method

ipfs-desktop

Version

Kubo version: 0.19.0
Repo version: 13
System version: amd64/linux
Golang version: go1.19.1

Config

Click to expand
{
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Methods": [
        "GET",
        "POST",
        "PUT"
      ],
      "Access-Control-Allow-Origin": [
        "https://webui.ipfs.io",
        "http://webui.ipfs.io.ipns.localhost:8080",
        "http://127.0.0.1:5001"
      ]
    }
  },
  "Addresses": {
    "API": "/ip4/0.0.0.0/tcp/5001",
    "Announce": [],
    "AppendAnnounce": [],
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic",
      "/ip4/0.0.0.0/udp/4001/quic-v1",
      "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
      "/ip6/::/udp/4001/quic",
      "/ip6/::/udp/4001/quic-v1",
      "/ip6/::/udp/4001/quic-v1/webtransport"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "99GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": false,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": {
      "chomp": {
        "InlineDNSLink": null,
        "NoDNSLink": false,
        "Paths": [
          "/ipfs",
          "/ipns"
        ],
        "UseSubdomains": false
      },
      "chomp.local": {
        "InlineDNSLink": null,
        "NoDNSLink": false,
        "Paths": [
          "/ipfs",
          "/ipns"
        ],
        "UseSubdomains": false
      }
    },
    "RootRedirect": "",
    "UseSubdomains": false,
    "Writable": false
  },
  "Identity": {
    "PeerID": "12D3KooWGDMwwqrpcYKpKCgxuKT2NfqPqa94QnkoBBpqvCaiCzWd"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": null
  },
  "Pinning": {
    "RemoteServices": {
      "pinata": {
        "API": {
          "Endpoint": "https://api.pinata.cloud/psa"
        },
        "Policies": {
          "MFS": {
            "Enable": false,
            "PinName": "",
            "RepinInterval": ""
          }
        }
      }
    }
  },
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {},
  "Routing": {
    "Methods": null,
    "Routers": null
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "1m0s",
      "HighWater": 40,
      "LowWater": 20,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {
      "Limits": {}
    },
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Description

The entries in the CBOR of an IPNS record aren't cased quite like the spec:
https://specs.ipfs.tech/ipns/ipns-record/#record-verification

In all but one case, the spec has the first letter of the key lowercase while Kubo has it upper, e.g. : validityType vs. ValidityType
The other case is ttl or TTL, which is all-lower in the spec and all-upper in Kubo.

I'm not sure if the issue is Kubo or the spec, but they should agree with each other.

@John-LittleBearLabs John-LittleBearLabs added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Apr 14, 2023
@lidel lidel transferred this issue from ipfs/kubo Apr 24, 2023
@lidel
Copy link
Member

lidel commented Apr 24, 2023

@John-LittleBearLabs thank you for reporting!

The spec was created a year after the data field was introduced, so we should fix the spec to reflect real world records.
These are not only created by Kubo, but also other software outside of our control.

Since you noticed this, do you mind opening PR against https://github.com/ipfs/specs/blob/main/src/ipns/ipns-record.md?

@lidel lidel added dif/easy Someone with a little familiarity can pick up P1 High: Likely tackled by core team if no one steps up effort/hours Estimated to take one or several hours and removed need/triage Needs initial labeling and prioritization labels Apr 24, 2023
@John-LittleBearLabs
Copy link
Contributor Author

@lidel - changing the spec was my preference as well.

#407

@John-LittleBearLabs thank you for reporting!

The spec was created a year after the data field was introduced, so we should fix the spec to reflect real world records. These are not only created by Kubo, but also other software outside of our control.

Since you noticed this, do you mind opening PR against https://github.com/ipfs/specs/blob/main/src/ipns/ipns-record.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dif/easy Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

No branches or pull requests

2 participants