Re: [Txauth] JSON Schema?

Wayne Chang <wyc@fastmail.fm> Mon, 06 July 2020 19:13 UTC

Return-Path: <wyc@fastmail.fm>
X-Original-To: txauth@ietfa.amsl.com
Delivered-To: txauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7979D3A09C6 for <txauth@ietfa.amsl.com>; Mon, 6 Jul 2020 12:13:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmail.fm header.b=raSkuz8z; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=NRf/qnK/
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DDAcfXl6YDYb for <txauth@ietfa.amsl.com>; Mon, 6 Jul 2020 12:13:03 -0700 (PDT)
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 999533A09C9 for <txauth@ietf.org>; Mon, 6 Jul 2020 12:13:03 -0700 (PDT)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 97181B12; Mon, 6 Jul 2020 15:13:01 -0400 (EDT)
Received: from imap2 ([10.202.2.52]) by compute2.internal (MEProxy); Mon, 06 Jul 2020 15:13:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=5S4D972RUGbey4+0d6qYjVyia3ViN9u 5wC5w62JMKIM=; b=raSkuz8z7HNZzqIrhGJwJ09m1h+avyMYcvjjcBH4mH2IBZ0 47jsmqrliSaWElJOB2fwFRp9wW1lHxPugWcYEFbUIfLHcGzgpTF07WfGt1DmiiP7 SUhmPXFpXwF5J4D7/fRDoI7bzt1h7FsAYvfKzUl9in8fGoYTkHrNevH25bHtWZQi EWJbSFYDgOeeZuctCtL4KCrSLMeGHxgUYTyIyDhkZ96BV2kqfKh3BLJ9cai2fl0J URKt/ZfV0nnAmbDlNTWlE1xpEqWi9yaFsPg1aFCA6RLfEjH5hiFocC2DATOyMgZ+ 65HWTcxA2dDwo5Ro1iP4MuCcwjR/ekOJxlXkyIw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=5S4D97 2RUGbey4+0d6qYjVyia3ViN9u5wC5w62JMKIM=; b=NRf/qnK/OhtZTAVvHzJi6O IePzRjlbtNSMKsok1ygx934aoUzXN9GTAZFakwITL3zBIxR2VYXDeVP8PBn5xj2Z vuOBkZde78lilYwlU3lQDGVDfF8c7pawx832KM+f352WlEjDfrzGajbYTg0PSvoa Yt0o03EdTXVDGuSRrur7X7IBp0Qb4pNHRpCEiaKts7Ew8Z8M7+Ve7D9Rap2hqhlX JYeeH1xKw7UHjMfPmA4EAgTJdgqvaWGDwFQUy3+FwasfdzIyqkH9vF4lZgeeKh6X IaQYLwNstHz7UkxI5jaJ4J6XEJH2xLVTluyy0rP91MsfhINsks0QGaLyG+aARTQg ==
X-ME-Sender: <xms:vHcDX_Bdbu7dv17Do5liEXYhR7N-sJqoPbcvsXuEc1fPrugAf5jd2Q>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudefgddufeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreertdenucfhrhhomhepfdghrgih nhgvucevhhgrnhhgfdcuoeifhigtsehfrghsthhmrghilhdrfhhmqeenucggtffrrghtth gvrhhnpeeugfeiueelueduleehkeelhfefgffhieevvdehtefgheffkeefudfhheduteet hfenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhjshhonhdqshgthhgvmhgrrdhorh hgpdhivghtfhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpeifhigtsehfrghsthhmrghilhdrfhhm
X-ME-Proxy: <xmx:vHcDX1i7ma6M7sRKme_Wx0cNJnkJsCL5xmlnueaRfWMUblweTLjAgg> <xmx:vHcDX6ksRnKPpU5N63Fu0ekqD5-dpU3GK_iidUVtTa_MVfqoRUai1A> <xmx:vHcDXxxGsLLvGZSgrJLvWavAN3aJvOQsWUN9zUmwP_NtbWpVd3FMLg> <xmx:vXcDX7eWknghvopceO7f_0rV_g07yhjeS7EnEVXbmNdw7rPQW8sfYA>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id BB230E00C9; Mon, 6 Jul 2020 15:13:00 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.3.0-dev0-576-gfe2cd66-fm-20200629.001-gfe2cd668
Mime-Version: 1.0
Message-Id: <0b47af92-76df-4ef7-9a74-11d94d9aaeb2@www.fastmail.com>
In-Reply-To: <CAD9ie-vnA98pobbboS00SAHneEG52_8eMxh_sE3r3jg6gyooGg@mail.gmail.com>
References: <CAD9ie-vnA98pobbboS00SAHneEG52_8eMxh_sE3r3jg6gyooGg@mail.gmail.com>
Date: Mon, 06 Jul 2020 15:12:40 -0400
From: "Wayne Chang" <wyc@fastmail.fm>
To: "Dick Hardt" <dick.hardt@gmail.com>, txauth@ietf.org
Content-Type: multipart/alternative; boundary=8cac1a1dddf34654a906b7d8270358e2
Archived-At: <https://mailarchive.ietf.org/arch/msg/txauth/BomR8wVHxEHyM2_i7QcxiXkRLkw>
Subject: Re: [Txauth] JSON Schema?
X-BeenThere: txauth@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <txauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/txauth>, <mailto:txauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/txauth/>
List-Post: <mailto:txauth@ietf.org>
List-Help: <mailto:txauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/txauth>, <mailto:txauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Jul 2020 19:13:06 -0000

I've used this approach to provide conformance tests to specifications. Here's a self-contained dir doing that:

https://github.com/decentralized-identity/presentation-exchange/tree/6b1b42338dd5ad96f67b7fee43187d96535b95a9/test/submission-requirements

It can then be run using `yarn run test`, as defined in:
https://github.com/decentralized-identity/presentation-exchange/blob/6b1b42338dd5ad96f67b7fee43187d96535b95a9/package.json#L20

Last note is that I see the v7 version with most supported implementations across different languages, so I've stuck with that one:
https://json-schema.org/draft-07/json-schema-release-notes.html

On Mon, Jul 6, 2020, at 3:00 PM, Dick Hardt wrote:
> Hey
> 
> Does anyone have experience and/or opinions on JSON Schema [1]?
> 
> When implementing XAuth [2], I wrote a bunch of hand crafted JSON validation code. JSON schema looks like it could be a great way to validate input, and to create automated tests for output. It may also be a great way to document the Grant Response JSON.
> 
> / Dick
> 
> [1] https://json-schema.org/
> [2] https://github.com/dickhardt/XAuth-poc
> 
> 
> -- 
> Txauth mailing list
> Txauth@ietf.org
> https://www.ietf.org/mailman/listinfo/txauth
>