You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "kindomLee (via GitHub)" <gi...@apache.org> on 2023/06/08 03:19:20 UTC
[GitHub] [apisix] kindomLee opened a new pull request, #9622: Docs google cloud logging
kindomLee opened a new pull request, #9622:
URL: https://github.com/apache/apisix/pull/9622
### Description
Add missing config field for google cloud logging plugin
* docs: add client_email field for google-cloud-logging plugin
* docs: add client_email field and log_format default value for google-cloud-logging plugin in zh
Fixes # (issue)
### 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)
--
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
[GitHub] [apisix] shreemaan-abhishek commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1635530385
I will take over the PR and add test cases. Thanks for the initial contribution @kindomLee.
--
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
[GitHub] [apisix] kindomLee commented on a diff in pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "kindomLee (via GitHub)" <gi...@apache.org>.
kindomLee commented on code in PR #9622:
URL: https://github.com/apache/apisix/pull/9622#discussion_r1230795746
##########
docs/zh/latest/plugins/google-cloud-logging.md:
##########
@@ -137,6 +139,7 @@ curl http://127.0.0.1:9180/apisix/admin/routes/1 \
"google-cloud-logging": {
"auth_config":{
"project_id":"apisix",
+ "client_email":"your service account email@apisix.iam.gserviceaccount.com",
Review Comment:
There’s a default value, so `token_uri` is not a required field in minimum settings
--
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
[GitHub] [apisix] kindomLee commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "kindomLee (via GitHub)" <gi...@apache.org>.
kindomLee commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1590555792
We need to set up Google authentication to authenticate to Logging, according to the existing code [1], we are currently using OAuth2.0 as our authentication method, and this method requires us to provide the `client_email` parameter [2].
[1] https://github.com/apache/apisix/blob/7ec3c0f583510ebcdf9c414f83792e1ac247a5b9/apisix/plugins/google-cloud-logging/oauth.lua#LL103C15-L103C15
[2] https://developers.google.com/identity/protocols/oauth2/service-account?hl=en#authorizingrequests
--
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
[GitHub] [apisix] kindomLee commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "kindomLee (via GitHub)" <gi...@apache.org>.
kindomLee commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1595646518
> Could you add `client_email` to the all test file, `google-cloud-logging.t`, `google-cloud-logging2.t`?
Sorry, I'm not very familiar with the lua testing framework, this part might need some other partners to help
> > We need to set up Google authentication to authenticate to Logging
>
> Could you create a issue about this?
I should say this, we have already provided two ways to read Google authentication when using the google cloud logging plugin, which are calling and passing in `auth_config` and reading the file `auth_file`[1]. When reading auth_file, the google client_email field is there so it won't cause any problems; but when authenticating through auth_config, because the default documentation description skips the client_mail setting, that's why it will cause an error. I don't think we need to raise another authentication issue
[1] https://github.com/apache/apisix/blob/7ec3c0f583510ebcdf9c414f83792e1ac247a5b9/apisix/plugins/google-cloud-logging.lua#L138
--
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
[GitHub] [apisix] kindomLee commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "kindomLee (via GitHub)" <gi...@apache.org>.
kindomLee commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1586654926
Thank you @monkeyDluffy6017 for your suggestion. I have added the missing config in schema as you advised. Could you please review my PR again and approve it if everything looks good? I hope we can merge this soon.
--
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
[GitHub] [apisix] kindomLee commented on a diff in pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "kindomLee (via GitHub)" <gi...@apache.org>.
kindomLee commented on code in PR #9622:
URL: https://github.com/apache/apisix/pull/9622#discussion_r1226156128
##########
apisix/plugins/google-cloud-logging.lua:
##########
@@ -62,7 +63,7 @@ local schema = {
default = "https://logging.googleapis.com/v2/entries:write"
},
},
- required = { "private_key", "project_id", "token_uri" }
+ required = { "client_email", "private_key", "project_id", "token_uri" }
Review Comment:
From the JWT claim set
https://developers.google.com/identity/protocols/oauth2/service-account?hl=en#authorizingrequests

--
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
[GitHub] [apisix] monkeyDluffy6017 commented on a diff in pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on code in PR #9622:
URL: https://github.com/apache/apisix/pull/9622#discussion_r1230790200
##########
docs/zh/latest/plugins/google-cloud-logging.md:
##########
@@ -137,6 +139,7 @@ curl http://127.0.0.1:9180/apisix/admin/routes/1 \
"google-cloud-logging": {
"auth_config":{
"project_id":"apisix",
+ "client_email":"your service account email@apisix.iam.gserviceaccount.com",
Review Comment:
The `token_uri` is missing here, could you help to add?
--
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
[GitHub] [apisix] moonming commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1635579530
@shreemaan-abhishek you can add test cases in this PR
--
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
[GitHub] [apisix] monkeyDluffy6017 merged pull request #9622: fix(google-cloud-logging): add missing config
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 merged PR #9622:
URL: https://github.com/apache/apisix/pull/9622
--
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
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1592788990
> We need to set up Google authentication to authenticate to Logging
Could you create a issue about this?
--
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
[GitHub] [apisix] shreemaan-abhishek commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1635538158
Raised #9836
--
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
[GitHub] [apisix] monkeyDluffy6017 commented on a diff in pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on code in PR #9622:
URL: https://github.com/apache/apisix/pull/9622#discussion_r1226145051
##########
apisix/plugins/google-cloud-logging.lua:
##########
@@ -62,7 +63,7 @@ local schema = {
default = "https://logging.googleapis.com/v2/entries:write"
},
},
- required = { "private_key", "project_id", "token_uri" }
+ required = { "client_email", "private_key", "project_id", "token_uri" }
Review Comment:
Could you show me the official doc that the google cloud logging need the `client_email`?
--
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
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1592785786
Could you add `client_email` to the all test file, `google-cloud-logging.t`, `google-cloud-logging2.t`?
--
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
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9622: docs: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1586628501
hi @kindomLee, you'd better add the missing config in schema too:
https://github.com/apache/apisix/blob/master/apisix/plugins/google-cloud-logging.lua#L38
--
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
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1600000101
> I should say this, we have already provided two ways to read Google authentication when using the google cloud logging plugin, which are calling and passing in auth_config and reading the file auth_file[1]. When reading auth_file, the google client_email field is there so it won't cause any problems; but when authenticating through auth_config, because the default documentation description skips the client_mail setting, that's why it will cause an error. I don't think we need to raise another authentication issue
I misunderstood you, I thought you wanted to add actual test cases
--
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
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9622: fix: add missing config in google cloud logging plugin
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9622:
URL: https://github.com/apache/apisix/pull/9622#issuecomment-1599998462
@kindomLee just add `client_email` in `auth_config` in test cases, or they will fail because this change:

--
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