Giter Club home page Giter Club logo

nsq-auth's Introduction

nsq-auth

nsq http auth service

 ./nsq-auth -h
Usage:

2021/12/25 17:10:56 Usage:
  nsq-auth [OPTIONS]

Application Options:
  -a, --address=  api port default :1325 (default: :1325)
  -i, --identity= identity default zhimiaox-nsq-auth (default: zhimiaox-nsq-auth)
  -u, --auth-url= auth-url (default: http://localhost:1325)
  -t, --ttl=      auth expire duration unit s, default 60 (default: 60)
  -s, --secret=   root secret allow all push and sub topic and channel
  -f, --csv=      csv secret file path

Help Options:
  -h, --help      Show this help message

Example Shell

root secret

./nsq-auth --secret "123456"
./nsqd --auth-http-address "localhost:1325"

csv file secret

./example.csv

secret topic channel allow
PrNQuOLcyAwDPJO7 t1 publish
PrNQuOLcyAwDPJO7 t1 c1 subscribe
PrNQuOLcyAwDPJO7 t2 .* publish subscribe
./nsq-auth --csv "./example.csv"
./nsqd --auth-http-address "localhost:1325"

Example Docker

docker pull zhimiao/nsq-auth:latest

./docker-compose.yml

version: "3"
services:
  nsqd:
    image: nsqio/nsq
    depends_on:
      - nsq-auth
    ports:
      - "4150:4150"
    volumes:
      - "./nsq/data:/data"
    restart: always
    command: /nsqd --auth-http-address="nsq-auth:1325"
  nsq-auth:
    image: zhimiao/nsq-auth:latest
    restart: always
    command: --secret="jV22WdmaXxHWAiAh"

Test

goos: windows
goarch: amd64
pkg: github.com/nsq-auth
cpu: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
BenchmarkApi_Auth
BenchmarkApi_Auth-16                2074            686007 ns/op
PASS

nsq-auth's People

Contributors

evildao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nsq-auth's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.