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

doc: update "enable-authentication-and-restriction.md" doc, and examples of jwt-auth and wolf-rbac. #1018

Merged
merged 9 commits into from
Jun 3, 2022

Conversation

AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented May 15, 2022

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What this PR does / why we need it:

Pre-submission checklist:

The doc update contains:

  • The jwt-auth config and example.
  • The wolf-rbac config.
  • The key-auth reference K8s Secret object in example.
  • Optimize content.
  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@AlinsRan
Copy link
Contributor Author

cc @navendu-pottekkat
Please help review it.

@tao12345666333 tao12345666333 added the documentation Improvements or additions to documentation label May 16, 2022
Consumers add their key either in a header `apikey` to authenticate their requests.
Consumers add their key either in a header `apikey` to authenticate their requests. For more information about `keyAuth`, please refer to [APISIX jwt-auth](https://apisix.apache.org/docs/apisix/plugins/key-auth/).

<details>
Copy link
Member

Choose a reason for hiding this comment

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

😂 May I know what's details usage 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.

3KYX3F0OV7J9)E59TCVYK{5
O)KPZ{9BSQK2V 4@}6E8 HG

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have specific reason to use this? If so, could you add it to the style guide on when to use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My idea is that there are many authentication methods we haven't written in. If we add configuration to each one later, it may appear very bloated. I think the display effect will be better if we use it. Users can choose the configuration content they care about. What do you think?

apiVersion: apisix.apache.org/v2beta3
kind: ApisixConsumer
metadata:
name: ${name}
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest we keep using the same style when passing variables, cc @navendu-pottekkat @hf400159

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I've added this to the next edition of the writing guide last week, and I'll be releasing the new style guide this Friday.

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlinsRan Does the ${name} here refer to a value the user has to set? Or is it somehow a variable they are passing?

In the past we have been using name: user-configured-name or some placeholder like that.

// @juzhiyuan @hf400159

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a variable that users can customize. Do I need to follow the style of the past?

@@ -314,10 +516,10 @@ EOF

**Example usage**

Requests from jack1:
* Requests from jack1:
Copy link
Member

Choose a reason for hiding this comment

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

Just to make sure: whether the * signal is added by your IDE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not, I added it.

Copy link
Member

Choose a reason for hiding this comment

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

So why not keep using -?

password: ${password} #required
```

</details>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think after each example, we need to give users a tip about using the valueRef field to reference a K8s Secret object so that we can avoid the hardcoded sensitive data in the ApisixConsumer object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solved.

Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

the content is correct

@juzhiyuan
Copy link
Member

Hi @navendu-pottekkat, please have a review when you have time, thanks!

@tao12345666333
Copy link
Member

a kind reminder @navendu-pottekkat @juzhiyuan @hf400159
please help with review in order to complete this PR

Copy link
Member

@juzhiyuan juzhiyuan left a comment

Choose a reason for hiding this comment

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

Only some grammar issues left, after updating we could merge.

@@ -314,10 +516,10 @@ EOF

**Example usage**

Requests from jack1:
* Requests from jack1:
Copy link
Member

Choose a reason for hiding this comment

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

So why not keep using -?

Co-authored-by: Jintao Zhang <tao12345666333@163.com>
Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

LGTM

let's move forward.

@juzhiyuan juzhiyuan merged commit d3a823f into apache:master Jun 3, 2022
stillfox-lee pushed a commit to stillfox-lee/apisix-ingress-controller that referenced this pull request Jun 7, 2022
…rbac examples. (apache#1018)

Co-authored-by: Jintao Zhang <tao12345666333@163.com>
@AlinsRan AlinsRan deleted the doc/auth branch June 9, 2022 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants