You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/03/17 10:26:32 UTC
[GitHub] [incubator-apisix-dashboard] sshniro opened a new pull request
#158: Adding api key for the request
sshniro opened a new pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158
Fix #137
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in
pull request #158: Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#discussion_r394083354
##########
File path: src/utils/request.ts
##########
@@ -51,6 +56,9 @@ const errorHandler = (error: { response: Response }): Response => {
const request = extend({
errorHandler, // 默认错误处理
credentials: 'include', // 默认请求是否带上cookie
+ headers: {
+ 'X-API-KEY': fetchAPIKey()
Review comment:
sorry, there should be

We just exported the API_KEY standalone, do not need put it in the default config value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in
pull request #158: Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#discussion_r394081680
##########
File path: src/utils/request.ts
##########
@@ -51,6 +56,9 @@ const errorHandler = (error: { response: Response }): Response => {
const request = extend({
errorHandler, // 默认错误处理
credentials: 'include', // 默认请求是否带上cookie
+ headers: {
+ 'X-API-KEY': fetchAPIKey()
Review comment:
and because the APISIX doesn't support fetching APIKEY , so we could use the fixed value now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan merged pull request #158:
Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] sshniro commented on a change in pull
request #158: Adding api key for the request
Posted by GitBox <gi...@apache.org>.
sshniro commented on a change in pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#discussion_r394203804
##########
File path: src/utils/request.ts
##########
@@ -51,6 +56,9 @@ const errorHandler = (error: { response: Response }): Response => {
const request = extend({
errorHandler, // 默认错误处理
credentials: 'include', // 默认请求是否带上cookie
+ headers: {
+ 'X-API-KEY': fetchAPIKey()
Review comment:
Thank you for the detailed explanation!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in
pull request #158: Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#discussion_r394081468
##########
File path: src/utils/request.ts
##########
@@ -51,6 +56,9 @@ const errorHandler = (error: { response: Response }): Response => {
const request = extend({
errorHandler, // 默认错误处理
credentials: 'include', // 默认请求是否带上cookie
+ headers: {
+ 'X-API-KEY': fetchAPIKey()
Review comment:
emm `IConfig` is just a typing, we could use:
```js
import {API_KEY} from '../../config/config'
headers: {
'X-API-KEY': API_KEY
}
```
directly here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] sshniro commented on issue #158:
Adding api key for the request
Posted by GitBox <gi...@apache.org>.
sshniro commented on issue #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#issuecomment-600519769
Sure! @juzhiyuan
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in
pull request #158: Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#discussion_r394083354
##########
File path: src/utils/request.ts
##########
@@ -51,6 +56,9 @@ const errorHandler = (error: { response: Response }): Response => {
const request = extend({
errorHandler, // 默认错误处理
credentials: 'include', // 默认请求是否带上cookie
+ headers: {
+ 'X-API-KEY': fetchAPIKey()
Review comment:
sorry, there should be

We just exported the API_KEY standalone, do not need put it in the default config value., or we have to extends the `IConfig` typing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #158:
Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#issuecomment-600517463
@sshniro Thank you for your contribution!
BTW, we'd better use `resolve #137` instead of `fix` :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in
pull request #158: Adding api key for the request
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #158: Adding api key for the request
URL: https://github.com/apache/incubator-apisix-dashboard/pull/158#discussion_r394083354
##########
File path: src/utils/request.ts
##########
@@ -51,6 +56,9 @@ const errorHandler = (error: { response: Response }): Response => {
const request = extend({
errorHandler, // 默认错误处理
credentials: 'include', // 默认请求是否带上cookie
+ headers: {
+ 'X-API-KEY': fetchAPIKey()
Review comment:
sorry, there should be

We just exported the API_KEY standalone, do not need put it in the default config value., or we have to extend the `IConfig` typing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services