npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

concorda-client-demo

v0.0.1

Published

A simple HAPI server that expose a REST API protected by Concorda user management service

Downloads

4

Readme

Banner

Concorda Client Demo

Concorda: A simple client demo exposing a REST API protected by Concorda user management system

A detailed documentation can be found in Concorda wiki

Starting demo client

  • clone this repository
  • run
npm install

Commands

To demo properly all API exposed automatically by concorda client the curl tool is used. Please find bellow examples of using curl with Concorda plugin.

For example of using Concorda with a React client implementation please take a look at this project - Vidi Dashboard

Login


curl -i -X POST -H "Content-Type: application/json" -d '{"username":"[email protected]", "password":"concorda"}' http://localhost:3000/auth/login
 
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
set-cookie: seneca-login=Fe26.2**599663fa9a8a5234937de49f4e06772fe685b1b0e8c3f367ae4946d963796ab9*LNOB3LreoPolrqN9FnSbNA*kGf4931n2wXbaya19nEzmuFoLJIows35RmTeAPfK8xUent-c3l6pD7g0B5QDmE067TG9B53p0jEdOvYsovP6aA**fe671ac75cdc47de2412421730a60aa2e5a8dbf18693ed1791ca7b41065809d4*Fdv8-uBSf22K7z7XSQV24WN-6Z6mroeNAY7Tdf-eqnA; HttpOnly; Path=/
cache-control: no-cache
content-length: 545
Date: Wed, 16 Mar 2016 09:08:24 GMT
Connection: keep-alive

{"user":{"id":"01be6250-d43f-44cf-b36b-ae325fbf4df1","nick":"[email protected]","email":"[email protected]","name":"Concorda Administrator","when":"2016-03-16T08:04:40.757Z","modified":null,"tags":[{"id":"9bcc1381-c07c-4bb0-8b46-dce970cb80d9","name":"Concorda"}]},"login":{"nick":"[email protected]","email":"[email protected]","user":"01be6250-d43f-44cf-b36b-ae325fbf4df1","when":"2016-03-16T09:08:24.229Z","active":true,"why":"password","token":"2769c1e1-4d1b-4a9a-8307-cfb70d6c8740","id":"2769c1e1-4d1b-4a9a-8307-cfb70d6c8740"},"ok":true}

User


curl -i -b 'seneca-login=Fe26.2**599663fa9a8a5234937de49f4e06772fe685b1b0e8c3f367ae4946d963796ab9*LNOB3LreoPolrqN9FnSbNA*kGf4931n2wXbaya19nEzmuFoLJIows35RmTeAPfK8xUent-c3l6pD7g0B5QDmE067TG9B53p0jEdOvYsovP6aA**fe671ac75cdc47de2412421730a60aa2e5a8dbf18693ed1791ca7b41065809d4*Fdv8-uBSf22K7z7XSQV24WN-6Z6mroeNAY7Tdf-eqnA' http://localhost:3000/auth/user

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
cache-control: no-cache
content-length: 570
accept-ranges: bytes
Date: Wed, 16 Mar 2016 09:12:43 GMT
Connection: keep-alive

{"user":{"id":"01be6250-d43f-44cf-b36b-ae325fbf4df1","nick":"[email protected]","email":"[email protected]","name":"Concorda Administrator","when":"2016-03-16T08:04:40.757Z","modified":null,"tags":[{"id":"9bcc1381-c07c-4bb0-8b46-dce970cb80d9","name":"Concorda"}]},"login":{"id":"2769c1e1-4d1b-4a9a-8307-cfb70d6c8740","nick":"[email protected]","email":"[email protected]","user":"01be6250-d43f-44cf-b36b-ae325fbf4df1","when":"2016-03-16T09:08:24.229Z","why":"password","token":"2769c1e1-4d1b-4a9a-8307-cfb70d6c8740","active":true,"auto":null,"ended":null},"ok":true}

Logout

curl -i -b 'seneca-login=Fe26.2**599663fa9a8a5234937de49f4e06772fe685b1b0e8c3f367ae4946d963796ab9*LNOB3LreoPolrqN9FnSbNA*kGf4931n2wXbaya19nEzmuFoLJIows35RmTeAPfK8xUent-c3l6pD7g0B5QDmE067TG9B53p0jEdOvYsovP6aA**fe671ac75cdc47de2412421730a60aa2e5a8dbf18693ed1791ca7b41065809d4*Fdv8-uBSf22K7z7XSQV24WN-6Z6mroeNAY7Tdf-eqnA' http://localhost:3000/auth/logout

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
set-cookie: seneca-login=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Path=/
cache-control: no-cache
content-length: 36
accept-ranges: bytes
Date: Wed, 16 Mar 2016 09:13:12 GMT
Connection: keep-alive

{"user":null,"login":null,"ok":true}

API protected

With authentcation cookie

curl -i -b 'seneca-login=Fe26.2**599663fa9a8a5234937de49f4e06772fe685b1b0e8c3f367ae4946d963796ab9*LNOB3LreoPolrqN9FnSbNA*kGf4931n2wXbaya19nEzmuFoLJIows35RmTeAPfK8xUent-c3l6pD7g0B5QDmE067TG9B53p0jEdOvYsovP6aA**fe671ac75cdc47de2412421730a60aa2e5a8dbf18693ed1791ca7b41065809d4*Fdv8-uBSf22K7z7XSQV24WN-6Z6mroeNAY7Tdf-eqnA' http://localhost:3000/api/service

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
cache-control: no-cache
content-length: 92
accept-ranges: bytes
Date: Wed, 16 Mar 2016 10:31:50 GMT
Connection: keep-alive

{"ok":true,"message":"Protected service. This server is accessed now by [email protected]"}

Without authentcation cookie

curl -i http://localhost:3000/api/service

HTTP/1.1 401 Unauthorized
WWW-Authenticate: cookie
content-type: application/json; charset=utf-8
cache-control: no-cache
content-length: 76
Date: Wed, 16 Mar 2016 10:34:02 GMT
Connection: keep-alive

{"statusCode":401,"error":"Unauthorized","message":"Missing authentication"}

Contributing

The Concorda encourages open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.

License

Copyright (c) 2016, nearForm and other contributors. Licensed under MIT.