Comments (7)
const (
DefaultSecretPrefix = "fist-user-"
)
type User struct {
Name string `json:"name"`
Passwd string `json:"passwd,omitempty"`
}
type UserService interface {
GetUser() error // GET
Login() //POST
AddUser() //POST
DelUser() //DELETE
UpdateUser() //PUT
}
用户的增删改查。
登录时 需要先判断是否是admin 在进行登录验证。
from fist.
是否有必要加用户组信息
type User struct {
Name string `json:"name"`
Passwd string `json:"passwd,omitempty"`
Groups []string `json:"groups"`
}
没有关系型数据库确实有点不太好维护。
from fist.
const (
DefaultSecretPrefix = "fist-user-"
)
type User struct {
Name string `json:"name"`
Passwd string `json:"passwd,omitempty"`
Groups []string `json:"groups"`
}
type UserService interface {
GetUser() error // GET
AddUser() //POST
DelUser() //DELETE
UpdateUser() //PUT
}
from fist.
后续可能会增加一些字段或者接口,如ListUsers(), 先就这样就可以了。 我在想管理员的账户密码能不能同样走这个接口
from fist.
管理员只涉及到 GetUser这个接口吧 ?那 进入系统后可以自建管理员么? 那这样需要把admin和用户重构一下设计。
from fist.
看了一下,管理员的就先不动。 User的可以开始写了,还好。 然后对secret的操作可以再封装一层:
SetSecret(screct string, key , value string)
GetSecret(secret string)map[string]string //或 GetSecret(secret string, key string) value string
然后就是kubeclientset, 感觉我们用的有点乱,是不是搞个全局的就行了。用个单例模式
from fist.
统一了所有的kubeclientset
分离每个k8s组件
k8s_(deploy,svc,ns).go
单独放自己相关组件的工具类
重新整了了所有的日志处理
from fist.
Related Issues (20)
- Ingress代理tty解决安全问题
- auth模块密钥对生成从文件读取 HOT 2
- 时间太短,干个100年
- 获取终端列表 HOT 2
- cors has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
- x509: certificate has expired or is not yet valid
- template从文件读取模板功能 HOT 1
- 执行器设计 HOT 2
- template模块,templates元数据列表查询接口
- webterminal访问入口
- 官网调整完新版页面后,会员登录出现了问题
- RBAC模块的验证功能 HOT 1
- RBAC模块以及重构功能 HOT 2
- token接口使用http
- oidc增加prefix参数 HOT 1
- tty清理功能无效 HOT 2
- Render 功能 HOT 1
- Namespace管理与PSP
- APP store功能
- pipeline功能
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fist.