Coder Social home page Coder Social logo

qwe's Introduction

keyauth

Go Report Card

keyauth是一个微服务权限治理中心, 提供用户认证与授权管理.

demo访问地址: Demo 用户: admin, 密码: 12345678mM@1

功能

  • 登录安全

    • 用户认证: Password/LDAP/AccessToken/Oauth2.0其他模式
    • 单点登录: 同一账号同一时间只能在一个客户端登录
    • 密码安全: 密码强度校验, 密码过期提醒, 密码重复限制
    • IP黑白名: 用户登录IP黑白名单限制
    • 异常登录: 失败重试检测, 异地登录检测, 30天未登录检测
    • 智能多因子认证: 异常登录时 支持邮件/短信方式对用户进行二次身份验证
    • 登录日志: 记录用户登录时间, 地点, IP, 登录端 等
  • 权限管理:

    • 部门管理: 部门人员和部门工作空间管理
    • 权限模型: 基于工作空间的【RBAC】授权
    • 角色管理: 基于标签的权限条目匹配, 灵活编辑角色
    • 服务目录: 服务将功能注册到keyauth, keyauth基于这些服务功能 提供RBAC鉴权机制

SDK使用

注意SDK权限很大, 仅供内部服务调用, 如果对外,请走HTTP API

package main

import (
	"context"
	"fmt"

	"github.com/infraboard/keyauth/apps/domain"
	"github.com/infraboard/keyauth/apps/user"
	"github.com/infraboard/keyauth/client"
)

func main() {
	conf := client.NewDefaultConfig()
	// 提前注册一个服务, 获取服务的client_id和client_secret
	conf.SetClientCredentials("pz3HiVQA3indzSHzFKtLHaJW", "vDvlAtqN3rS9CZcHugXp6QBuk28zRjud")
	c, err := client.NewClient(conf)
	if err != nil {
		panic(err)
	}

	// 查询用户信息, 查询admin domain里面的用户
	req := user.NewQueryAccountRequest()
	req.Domain = domain.AdminDomainName
	eps, err := c.User().QueryAccount(context.Background(), req)
	fmt.Println(eps, err)
}

快速开发

  1. 依赖环境搭建:
  1. 快速运行
# 安装依赖
make install

# 配置
mv /etc/keyauth_sample.toml /etc/keyauth.toml
vim /etc/keyauth.toml

# 初始化服务
make init

# 启动服务
make run

qwe's People

Contributors

yumaojun03 avatar guozhengli avatar dependabot[bot] avatar

Watchers

 avatar

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.