-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task isolation #152
task isolation #152
Conversation
server/README.md
Outdated
@@ -69,6 +68,10 @@ Response: | |||
|
|||
#### ConnectDB API | |||
|
|||
Header: | |||
|
|||
Authorization 1 cm9vdDoxMjM= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first 1 is useless,cm9vdDoxMjM= is the token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's useless, why is it here?
server/README.md
Outdated
"nsid": "e870674d-6ebc-4d9d-a1f7-bf59fdca24e8", | ||
"version": "v2.6" | ||
"nsid": "da821d0e-1bc5-4407-ab04-9dbcfa1dd3fb", | ||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuZWJ1bGFBZGRyZXNzIjoiMTkyLjE2OC44LjIzMzo5NjY5IiwidXNlcm5hbWUiOiJyb290In0.zP6LxNByhG1XGrzEowljBz6UkDfbm66e7Njd3zHdSio", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not put it in header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok,I put them in cookie
server/pkg/webserver/base/scheme.go
Outdated
func hookHandler(h Hook, desc string) iris.Handler { | ||
return func(ctx iris.Context) { | ||
// pass route description to handler | ||
ctx.Values().Set("routeDesc", desc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass route description to handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why need this? where to used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have del it
} | ||
) | ||
|
||
func GetLoginTokenHandler(nebulaAddress string, username string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetLoginToken
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
) | ||
|
||
var ( | ||
mySecret = []byte("login secret") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it in next version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add TODO here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add TODO here.
// TODO: Make it configurable
mySecret = []byte("login secret")
I hava added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
"nebulaAddress": nebulaAddress, | ||
"username": username, | ||
}) | ||
tokenString, _ := token.SignedString(mySecret) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it impossible to fail here?
ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { | ||
return mySecret, nil | ||
}, | ||
Expiration: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it never expire? Is it possible to set an expiration time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have set it.
"nebulaAddress": nebulaAddress, | ||
"username": username, | ||
"iat": now.Unix(), | ||
"exp": now.Add(24 * time.Hour).Unix(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be refreshed automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.