{"id":19163250,"url":"https://github.com/oada/oada-client-discovery-js","last_synced_at":"2025-06-20T23:07:35.652Z","repository":{"id":21947289,"uuid":"25271793","full_name":"OADA/oada-client-discovery-js","owner":"OADA","description":"OADA client discovery middleware","archived":false,"fork":false,"pushed_at":"2023-01-10T07:43:29.000Z","size":20,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-20T23:06:49.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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-15T20:15:12.000Z","updated_at":"2014-10-15T21:11:48.000Z","dependencies_parsed_at":"2023-01-11T21:25:10.203Z","dependency_job_id":null,"html_url":"https://github.com/OADA/oada-client-discovery-js","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/OADA/oada-client-discovery-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-client-discovery-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-client-discovery-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-client-discovery-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-client-discovery-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OADA","download_url":"https://codeload.github.com/OADA/oada-client-discovery-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-client-discovery-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261032071,"owners_count":23100049,"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","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":[],"created_at":"2024-11-09T09:14:39.232Z","updated_at":"2025-06-20T23:07:30.635Z","avatar_url":"https://github.com/OADA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"* This repository is deprecated. CLient discovery is no longer an OADA protocol. *\n\n[![Build Status](https://travis-ci.org/OADA/oada-client-discovery-js.svg)](https://travis-ci.org/OADA/oada-client-discovery-js)\n[![Coverage Status](https://coveralls.io/repos/OADA/oada-client-discovery-js/badge.png?branch=master)](https://coveralls.io/r/OADA/oada-client-discovery-js?branch=master)\n[![Dependency Status](https://david-dm.org/oada/oada-client-discovery-js.svg)](https://david-dm.org/oada/oada-client-discovery-js)\n[![License](http://img.shields.io/:license-Apache%202.0-green.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n# oada-client-discovery-js\nConnect style middleware for OADA (openag.io) client discovery.\n\n## Getting Started\n\n### Installation ###\nThe library can be installed with `npm` using\n```sh\n$ npm install oada-client-discovery\n```\n\n### Running the Examples ###\n\n#### Minimal Example ##\n\nSee [examples README](examples/README.md)\n\n### Running the tests, coverage, and style checks ###\nThe libraries test can be ran with:\n```sh\n$ npm test\n```\n\nThe coverage report is generated by:\n```sh\n$ npm run cover\n```\n\nGulp runs `jshint` (lint) and `jscs` (style) with:\n```sh\n$ gulp lint\n$ gulp style\n```\n\n## API\n\n### clientDiscovery(lookup, options) ###\nConnect style middleware for [OADA][oada-docs] client discovery.\n\nTo eliminate a dependency on any particular storage system or database a\n`lookup` function that fetches client registrations must be provided by the\ncaller.\n\n[CORS][cors] is required by OADA client discovery and therefore automatically\nenabled. See [node-cors][node-cors].\n\n#### Parameters ####\n`lookup` {Function} that resolves a client registration from a client ID. It\ntakes the form `function(lookup, callback)`.\n\n`options` {Object, *Optional*} possibly containing the following properties:\n\n* `cors` {Object} Options object for [node-cors][node-cors]. *Default: {}*\n\n\n#### Client Registration Object ####\nAn OADA client registration is a JSON document with at least the following\nproperties:\n\n* `clientId` {String} client ID\n* `redirectUrls` {Array of Strings} Array of allowable OAuth 2.0 redirect URLs.\n* `licenses` {Array of Strings} Array of license names the client developer has\nagreed to.\n* `keys` {[JSON Web Key (JWK) Set][jwks]} containing the client's JWKs for use\nwith OADA specific OAuth 2.0/OpenID Connect client secrets.\n\n##### Example Client Registration #####\n```json\n{\n  \"clientId\": \"123abc@agcloud.com\",\n  \"redirectUrls\": [\n    \"https://agcloud.com/redirect\"\n  ],\n  \"licenses\": [\n    \"oada\",\n  ],\n  \"keys\": [\n    {\n      \"kty\": \"RSA\",\n      \"use\": \"sig\",\n      \"alg\": \"RS256\",\n      \"kid\": \"ad8alkjca38afvudsZA\",\n      \"n\": \"AOtWalmH3vZ2q2Be ... SRQjYzxqpyVR9HEJYJ\",\n      \"e\": \"AQAB\",\n    }\n  ]\n}\n```\n\n#### Usage Example ####\n```javascript\nvar express = require('express');\nvar clientDiscovery = require('oada-client-discovery');\n\nvar app = express();\n\napp.get('/clientDiscovery', clientDiscovery(\n  function(clientId, cb) {\n    clients.find({clientId: clientId}, function(err, clients) {\n      if(err) { return cb(err); }\n\n      cb(null, clients[0]);\n    })\n  }));\n```\n\n[oada-docs]: http://github.com/OADA/oada-docs\n[cors]: http://www.w3.org/TR/cors/\n[node-cors]: https://github.com/troygoode/node-cors\n[jwks]: https://tools.ietf.org/html/draft-ietf-jose-json-web-key-33#section-5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Foada-client-discovery-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foada%2Foada-client-discovery-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Foada-client-discovery-js/lists"}