{"id":19163243,"url":"https://github.com/oada/oada-lookup-js","last_synced_at":"2025-07-31T05:10:38.308Z","repository":{"id":21377187,"uuid":"24694590","full_name":"OADA/oada-lookup-js","owner":"OADA","description":"JavaScript utility library to lookup OADA documents such as Well-Known (RFC 5785) resource, e.g., oada-configuration, openid-configuration, etc, and public OADA client registrations","archived":false,"fork":false,"pushed_at":"2023-02-04T10:24:14.000Z","size":1670,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-07T17:51:16.371Z","etag":null,"topics":["oada","oada-configuration","openid-configuration"],"latest_commit_sha":null,"homepage":"http://openag.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OADA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-01T20:39:24.000Z","updated_at":"2022-04-19T05:47:57.000Z","dependencies_parsed_at":"2023-02-13T20:46:06.829Z","dependency_job_id":null,"html_url":"https://github.com/OADA/oada-lookup-js","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/OADA/oada-lookup-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-lookup-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-lookup-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-lookup-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-lookup-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OADA","download_url":"https://codeload.github.com/OADA/oada-lookup-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-lookup-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267989088,"owners_count":24177020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oada","oada-configuration","openid-configuration"],"created_at":"2024-11-09T09:14:38.863Z","updated_at":"2025-07-31T05:10:38.281Z","avatar_url":"https://github.com/OADA.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @oada/lookup\n\n[![Coverage Status](https://coveralls.io/repos/OADA/oada-lookup-js/badge.png?branch=master)](https://coveralls.io/r/OADA/oada-lookup-js?branch=master)\n[![npm](https://img.shields.io/npm/v/@oada/lookup)](https://www.npmjs.com/package/@oada/lookup)\n[![Downloads/week](https://img.shields.io/npm/dw/@oada/lookup.svg)](https://npmjs.org/package/@oada/lookup)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![License](https://img.shields.io/github/license/OADA/oada-lookup-js)](LICENSE)\n\nJavaScript utility library to lookup OADA documents such as [Well-Known (RFC 5785)][well-known] resource, e.g., oada-configuration, [openid-configuration][],\netc, and public OADA client registrations.\n\n## Getting Started\n\n### Installation\n\nThe library can be installed with `yarn` using\n\n```sh\nyarn add @oada/lookup\n```\n\n### Running the tests, coverage, and style checks\n\nThe libraries test can be ran with:\n\n```sh\nyarn test\n```\n\n### wellKnown(hostname, suffix, options, cb)\n\nFetch a [Well-Known (RFC 5785)][well-known] Resource. The hostname will\nautomatically be parsed from any URL.\n\n#### Parameters\n\n`hostname` {String} Hostname (or URL) hosting the Well-Known resource being\nrequested. Sub-domains and ports are be persevered; Protocol, path, query\nparameters, and hash are dropped. It is assumed that the Well-Known resource is\nhosted with TLS (https) _Pull Request appreciated_\n\n[`suffix`][] {String} Well-Known resource suffix being requested.\n\n`options` {Object} containing at least the following properties:\n\n- `timeout` {Number} _Default: 1000_ Timeout before HTTP request fails in ms.\n\n`cb` {Function} Result callback. It takes the form `function(err, resource) {}`.\n\n#### Usage Example\n\n```javascript\nimport { wellKnown } from '@oada/lookup';\n\nconst options = {\n  timeout: 500,\n};\n\nconst resource = await wellKnown(\n  'provider.oada-dev.com',\n  'oada-configuration',\n  options\n);\nconsole.log(resource);\n```\n\n### clientRegistration(clientId, options, cb)\n\nFetch a client registration from an OADA client id.\n\n#### Parameters\n\n`clientId` {String} The OADA client id to lookup the client registration for. It\ntakes a form similar to email: `id@domain`.\n\n`options` {Object} containing at least the following properties:\n\n- `timeout` {Number} _Default: 1000_ Timeout before HTTP request fails in ms.\n\n`cb` {Function} Result callback. It takes the form `function(err, registration){}`.\n\n#### Usage Example\n\n```javascript\nimport { clientRegistration } from '@oada/lookup';\n\nconst options = {\n  timeout: 500,\n};\n\nconst registration = await clientRegistration(\n  'xJx82s@provider.oada-dev.com',\n  options\n);\nconsole.log(registration);\n```\n\n### jwks(uri, options, cb)\n\nFetch a [Json Web Key Set (JWKS)][json-web-key-set] from an URI.\n\n#### Parameters\n\n`uri` {String} The URI containing the desired JWKS document. For example, the\nvalue of the OpenID Connect openid-configuration `jwks_uri` property.\n\n`options` {Object} containing at least the following properties:\n\n- `timeout` {Number} _Default: 1000_ Timeout before HTTP request fails in ms.\n\n`cb` {Function} Result callback. It takes the form `function(err, jwks){}`.\n\n#### Usage Example\n\n```javascript\nimport { jwks } from '@oada/lookup';\n\nconst options = {\n  timeout: 500,\n};\n\nconst JWKset = await jwks('provider.oada-dev.com/oidc/jwks', options);\nconsole.log(JWKset);\n```\n\n## References\n\n1. [Defining Well-Known Uniform Resource Identifiers (URIs)][well-known]\n2. [OpenID Discovery](http://openid.net/specs/openid-connect-discovery-1_0.html)\n\n[well-known]: http://tools.ietf.org/html/rfc5785\n[openid-configuration]: http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\n[`suffix`]: http://tools.ietf.org/html/rfc5785#section-5.1.1 'RFC5785 Section 5.1.1'\n[json-web-key-set]: https://tools.ietf.org/html/draft-ietf-jose-json-web-key-33#page-10\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Foada-lookup-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foada%2Foada-lookup-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Foada-lookup-js/lists"}