You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "shreemaan-abhishek (via GitHub)" <gi...@apache.org> on 2026/02/10 06:59:27 UTC
[PR] feat: support authentication via headers [apisix]
shreemaan-abhishek opened a new pull request, #12994:
URL: https://github.com/apache/apisix/pull/12994
### Description
<!-- Please include a summary of the change and which issue is fixed. -->
<!-- Please also include relevant motivation and context. -->
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
### Checklist
- [ ] I have explained the need for this PR and the problem it solves
- [ ] I have explained the changes or the new features added to this PR
- [ ] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
<!--
Note
1. Mark the PR as draft until it's ready to be reviewed.
2. Always add/update tests for any changes unless you have a good reason.
3. Always update the documentation to reflect the changes made in the PR.
4. Make a new commit to resolve conversations instead of `push -f`.
5. To resolve merge conflicts, merge master instead of rebasing.
6. Use "request review" to notify the reviewer after making changes.
7. Only a reviewer can mark a conversation as resolved.
-->
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support authentication via headers [apisix]
Posted by "nic-6443 (via GitHub)" <gi...@apache.org>.
nic-6443 commented on code in PR #12994:
URL: https://github.com/apache/apisix/pull/12994#discussion_r2791826683
##########
apisix/plugins/elasticsearch-logger.lua:
##########
@@ -62,8 +63,20 @@ local schema = {
type = "string",
minLength = 1
},
+ header_name = {
+ type = "string",
+ minLength = 1
+ },
+ header_value = {
+ type = "string",
+ minLength = 1
+ }
Review Comment:
for example:
```
auth:
username: ..
password: ..
headers:
apikey: xx
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support authentication via headers [apisix]
Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #12994:
URL: https://github.com/apache/apisix/pull/12994#discussion_r2792011657
##########
docs/zh/latest/plugins/elasticsearch-logger.md:
##########
@@ -47,6 +47,7 @@ description: elasticsearch-logger Plugin 将请求和响应日志批量推送到
| auth | array | 否 | | Elasticsearch [身份验证](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html) 配置。 |
| auth.username | string | 是 | | Elasticsearch [身份验证](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html) 用户名。 |
| auth.password | string | 是 | | Elasticsearch [身份验证](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html) 密码。 |
+| headers | object | 否 | | 自定义请求标头,以键值对形式配置。例如:`{"Authorization": "Bearer token", "X-API-Key": "key"}`。 |
Review Comment:
```suggestion
| headers | object | 否 | | 自定义请求标头,以键值对形式配置。例如 `{"Authorization": "Bearer token", "X-API-Key": "key"}`。 |
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support authentication via headers [apisix]
Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #12994:
URL: https://github.com/apache/apisix/pull/12994#discussion_r2792011657
##########
docs/zh/latest/plugins/elasticsearch-logger.md:
##########
@@ -47,6 +47,7 @@ description: elasticsearch-logger Plugin 将请求和响应日志批量推送到
| auth | array | 否 | | Elasticsearch [身份验证](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html) 配置。 |
| auth.username | string | 是 | | Elasticsearch [身份验证](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html) 用户名。 |
| auth.password | string | 是 | | Elasticsearch [身份验证](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-up-authentication.html) 密码。 |
+| headers | object | 否 | | 自定义请求标头,以键值对形式配置。例如:`{"Authorization": "Bearer token", "X-API-Key": "key"}`。 |
Review Comment:
```suggestion
| headers | object | 否 | | 自定义请求标头,以键值对形式配置。例如:`{"Authorization": "Bearer token", "X-API-Key": "key"}`。 |
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support authentication via headers [apisix]
Posted by "nic-6443 (via GitHub)" <gi...@apache.org>.
nic-6443 commented on code in PR #12994:
URL: https://github.com/apache/apisix/pull/12994#discussion_r2791781788
##########
apisix/plugins/elasticsearch-logger.lua:
##########
@@ -62,8 +63,20 @@ local schema = {
type = "string",
minLength = 1
},
+ header_name = {
+ type = "string",
+ minLength = 1
+ },
+ header_value = {
+ type = "string",
+ minLength = 1
+ }
Review Comment:
I suggest using the key-value form directly, as this can support the needs for custom request headers in more scenarios.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: support authentication via headers [apisix]
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek merged PR #12994:
URL: https://github.com/apache/apisix/pull/12994
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org