303 private links
C'est bien pratique pour manipuler un format plus simple que les vcards.
La version 2 rend l'uid optionel afin de suivre le format vCard
The library parses rich schemas (nested sections, $ref, arrays, key/value maps, pattern properties…) into a navigable form tree, renders it as a keyboard-first editor, and validates the result after every edit so users always see the full list of issues before saving.
It can be useful someday
It can be useful someday
The website author is available in different format than HTMLz
JSON module imports became baseline: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with:
import data from './data.json' with { type: 'json' };
and lazy-load it with:
const { default: data } = await import('./data.json', {
with: { type: 'json' },
});
It makes sense to use JSON module imports for local static JSON resources where you need all/most of the data within. Particularly since bundlers can understand JSON imports, and bundle the object with other modules. That isn't possible with fetch(), unless you use some pretty hacky plugins.
Generally, I try to turn any "fetch-and-process" logic into a Vite/Rollup plugin, so it happens at build time rather than runtime.
The parsers are different in JS, Python, Go and Java.
Number are not precise:
- MAX_SAFE_INTEGER limits the number. Twitter had to use an `id_str.
- decimal precision is unreliable (in JS) --> always use dedicated decimal types (Python’s Decimal, Java’s BigDecimal, JavaScript’s decimal libraries)
- UTF-8 encoding in JSON allow single unicode code points or composed ones. Use
.normalize("NFC")for JS strings. - the object key order should be alphabetically in JSON.
- Different languages handle absence of values (
undefined,nullor a missing property) differently. - No time format is official, so it's always custom:
{ "iso_string": "2023-01-15T10:30:00.000Z", "unix_timestamp": 1673780200, "unix_milliseconds": 1673780200000, "date_only": "2023-01-15", "custom_format": "15/01/2023 10:30:00" } - Different parsers fail differently on malformed JSON.
The twitter example is only one. There is also postgres that stores the format as JSON and JSONB (normalized).
MongoDB uses an extended JSON format.
Workarounds:
- Use Schema Validation!
- custom normalisation function#:~:text=Normalize%20Data%20Types%3A%20Ender%E2%80%99s%20Data%20Normalization%20Game)
- Tests! Numeric Precision Tests, Unicode and String Handling, Date and Time Consistency, Error Handling Uniformity, Cryptographic Consistency, Performance and Memory Behavior
[Summary generated by ChatGPT]
The article provides an overview of the JOSE (JSON Object Signing and Encryption) framework, a family of standards for securing JSON-based data and communications. It explains the major JOSE components and how they work together.
Key Components
-
JWS (JSON Web Signature): Adds a digital signature to JSON data to ensure integrity (the data wasn't altered) and authenticity (it came from the expected sender). A JWS contains a header, payload, and signature. It does not encrypt the content, so anyone can read it.
-
JWE (JSON Web Encryption): Encrypts JSON content to provide confidentiality. The article describes the typical process: generate an encryption key, encrypt the payload, encrypt the key for the recipient, and package everything into a JWE structure containing metadata, encrypted key, initialization vector, ciphertext, and authentication information.
-
JWK (JSON Web Key): A standardized JSON representation of cryptographic keys. JWKs can represent RSA, EC, symmetric, and other key types, and include metadata such as key type, algorithm, usage, and key ID. They are used by JWS and JWE for signing, verification, encryption, and decryption. ([Medium][1])
-
JWT (JSON Web Token): A compact token format commonly used for authentication and authorization. A JWT consists of:
- Header (algorithm and token type)
- Payload (claims/data)
- Signature (verification data)
JWTs allow systems to securely transmit user identity and permissions without repeatedly querying a database. The article emphasizes that JWTs should still be used over secure channels such as HTTPS.
-
JWA (JSON Web Algorithms): Defines the cryptographic algorithms used by JWS and JWE for signing, encryption, and key management.
Security Goals Addressed by JOSE
The framework is designed to support four common security objectives:
| Objective | Provided By |
|---|---|
| Integrity | JWS |
| Authenticity | JWS |
| Confidentiality | JWE |
| Non-repudiation | Primarily via digital signatures |
([Medium][1])
JWE vs. HSM
The article briefly compares JWE with Hardware Security Modules (HSMs):
- JWE protects data in transit through encryption.
- HSMs are physical devices that securely store and manage cryptographic keys and perform cryptographic operations.
They solve different security problems and are often complementary.
Main Takeaways
- Use JWS when you need proof that data has not been modified.
- Use JWE when the data must remain secret.
- Use JWK to exchange and manage cryptographic keys in a standardized format.
- Use JWT to package claims or identity information in a compact, signed (and optionally encrypted) token.
- JOSE provides interoperable, language-agnostic standards that are widely adopted across industries for secure API and application communication.
In one sentence: JOSE is a toolkit of standards that lets developers sign, encrypt, manage keys, and securely transmit JSON-based information in a consistent and interoperable way.
Ok interesting
import a json file that can be manipulated with the unix filesystem tools and rexport it to json.
Describe a JSON structure
The post covers the JSON format with different topics.
All that we did to get this speedup is implement the Serialize trait using one line for the body of the serialize method!
But implementing the trait directly loses the possibility to serialize the structure with the #derive(Serialize) macro.
Instead, you should implement it on wrapper types that act like formatters.
Also for efficiency: format_args! doesn't allocate or even apply the formatting! It only returns Arguments which is a formatter that borrows its arguments.
An extension of JSON to allow one valid JSON entity per line.
It optimize the parsing because the entire JSON file does not have to be loaded first.
Simple to use local JSON database. Use native JavaScript API to query. Written in TypeScript. owl
Seamlessly visualize your JSON data instantly into graphs.