Skip to content
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

Merged
merged 1 commit into from
Mar 23, 2022
Merged

task isolation #152

merged 1 commit into from
Mar 23, 2022

Conversation

xjlgod
Copy link
Contributor

@xjlgod xjlgod commented Mar 21, 2022

No description provided.

server/README.md Outdated
@@ -69,6 +68,10 @@ Response:

#### ConnectDB API

Header:

Authorization 1 cm9vdDoxMjM=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it means?

Copy link
Contributor Author

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

Copy link
Contributor

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",
Copy link
Contributor

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?

Copy link
Contributor Author

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

func hookHandler(h Hook, desc string) iris.Handler {
return func(ctx iris.Context) {
// pass route description to handler
ctx.Values().Set("routeDesc", desc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetLoginToken?

Copy link
Contributor Author

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it configurable?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add TODO here.

Copy link
Contributor Author

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.

Copy link
Contributor

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)
Copy link
Contributor

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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(),
Copy link
Contributor

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?

@veezhang veezhang self-requested a review March 23, 2022 06:54
Copy link
Contributor

@veezhang veezhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@veezhang veezhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@veezhang veezhang merged commit d8c27b7 into vesoft-inc:v3.3.0-dev Mar 23, 2022
hetao92 pushed a commit to hetao92/nebula-studio that referenced this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants