Error on unknown comprehension-required attributes w/strict#276
Error on unknown comprehension-required attributes w/strict#276
Conversation
| var attrNames = map[AttrType]string{ | ||
| AttrMappedAddress: "MAPPED-ADDRESS", | ||
| AttrUsername: "USERNAME", | ||
| AttrErrorCode: "ERROR-CODE", | ||
| AttrMessageIntegrity: "MESSAGE-INTEGRITY", | ||
| AttrUnknownAttributes: "UNKNOWN-ATTRIBUTES", | ||
| AttrRealm: "REALM", | ||
| AttrNonce: "NONCE", | ||
| AttrXORMappedAddress: "XOR-MAPPED-ADDRESS", | ||
| AttrSoftware: "SOFTWARE", | ||
| AttrAlternateServer: "ALTERNATE-SERVER", | ||
| AttrFingerprint: "FINGERPRINT", | ||
| AttrPriority: "PRIORITY", | ||
| AttrUseCandidate: "USE-CANDIDATE", | ||
| AttrICEControlled: "ICE-CONTROLLED", | ||
| AttrICEControlling: "ICE-CONTROLLING", | ||
| AttrChannelNumber: "CHANNEL-NUMBER", | ||
| AttrLifetime: "LIFETIME", | ||
| AttrXORPeerAddress: "XOR-PEER-ADDRESS", | ||
| AttrData: "DATA", | ||
| AttrXORRelayedAddress: "XOR-RELAYED-ADDRESS", | ||
| AttrEvenPort: "EVEN-PORT", | ||
| AttrRequestedTransport: "REQUESTED-TRANSPORT", | ||
| AttrDontFragment: "DONT-FRAGMENT", | ||
| AttrReservationToken: "RESERVATION-TOKEN", | ||
| AttrConnectionID: "CONNECTION-ID", | ||
| AttrRequestedAddressFamily: "REQUESTED-ADDRESS-FAMILY", | ||
| AttrMessageIntegritySHA256: "MESSAGE-INTEGRITY-SHA256", | ||
| AttrPasswordAlgorithm: "PASSWORD-ALGORITHM", | ||
| AttrUserhash: "USERHASH", | ||
| AttrPasswordAlgorithms: "PASSWORD-ALGORITHMS", | ||
| AttrAlternateDomain: "ALTERNATE-DOMAIN", | ||
| AttrDtlsInStun: "DTLS-IN-STUN", | ||
| AttrDtlsInStunAck: "DTLS-IN-STUN-ACKNOWLEDGEMENT", | ||
| } |
There was a problem hiding this comment.
not related, but I wonder if we should refactor this, and other Pion libraries so that IANA fields are automated in the CI (cron-job and check?), I did this for a rust SDP library I'm developing with @Juliapixel
https://github.com/meowdia/sphynx/blob/main/src/iana/generated.rs
meowdia/sphynx#6
There was a problem hiding this comment.
Yeah... what I have done in the past is to let depending packages (i.e. a TURN package) register methods and attributes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #276 +/- ##
==========================================
- Coverage 66.43% 65.98% -0.45%
==========================================
Files 27 27
Lines 2124 2096 -28
==========================================
- Hits 1411 1383 -28
Misses 700 700
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Throws an error when encountering a unknown comprehension-required attribute in strict mode and log a warning in non-strict mode.
Throws an error when encountering a unknown comprehension-required attribute in strict mode and log a warning in non-strict mode.
(not sure if this is worth it even...)