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: add 'enable authentication and restriction' document #972

Merged
merged 40 commits into from
May 11, 2022

Conversation

AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented Apr 19, 2022

Type of change:

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

What this PR does / why we need it:

Pre-submission checklist:

  • 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

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.

thanks!

EOF
```

**Test keyAuth**
Copy link
Member

Choose a reason for hiding this comment

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

I think an example without headers can be added here.

enable: true
config:
whitelist:
- "default_jack1"
Copy link
Member

Choose a reason for hiding this comment

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

Here you can add its generated rules

@tao12345666333 tao12345666333 added the documentation Improvements or additions to documentation label Apr 19, 2022
@AlinsRan AlinsRan changed the title add 'enable authentication and restriction' document Doc: add 'enable authentication and restriction' document Apr 19, 2022
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

Copy link
Contributor

@guitu168 guitu168 left a comment

Choose a reason for hiding this comment

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

LGTM

Requests from jack1:

```shell
kubectl exec -it -n ${namespace of Apache APISIX} ${pod of Apache APISIX} -- curl http://127.0.0.1:9080/anything -H 'Host: local.httpbin.org' -H 'apikey:jack1-key' -v
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually, the command and return result need to be separated. And for long commands, we need to format them. Please check the full text.

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

@juzhiyuan
Copy link
Member

And @navendu-pottekkat, also this one.


## Description

Consumers are useful when you have different consumers requesting the same API and you need to execute different Plugin and Upstream configurations based on the consumer. These need to be used in conjunction with the user authentication system.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consumers are used for the authentication method controlled by Apache APISIX, if users want to use their own auth system or 3rd party systems, use OIDC.

@tao12345666333
Copy link
Member

ping @tokers @navendu-pottekkat for review, thanks

Copy link
Contributor

@pottekkat pottekkat left a comment

Choose a reason for hiding this comment

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

You can mention the plugins being used in the first step and link every reference to a particular Plugin to its documentation page.

Apisix to APISIX.

Comment on lines 93 to 97
Kubernetes cluster:

1. [apisix-ingress-controller](../deployments/minikube.md).
2. httpbin.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make this clearer that we want readers to setup APISIX ingress and install HTTPBin on their cluster?

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 don't think it's necessary.

  1. This article mainly demonstrates the use of ApisixConsumer.
  2. The focus is not on the installation of the environment.
  3. This is based on the fact that the user can already use APISIX Ingress and Kubernetes.

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 agree that we shouldn't talk about how to install but I think we should make it clear that the **user have to install ingress controller and HTTPbin for the rest of the tutorial to work. Point to other documents on how to do that.

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!

Comment on lines 233 to 246
How to get `default_jack1`:

> view ApisixConsumer resource object from this namespace `default`
>
> ```shell
> $ kubectl get apisixconsumers.apisix.apache.org -n default
> NAME AGE
> foo 14h
> jack1 14h
> jack2 14h
> ```
>
> `${consumer_name}` = `${namespace}_${ApisixConsumer_name}` --> `default_foo`
> `${consumer_name}` = `${namespace}_${ApisixConsumer_name}` --> `default_jack1`
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 follow this style elsewhere? Would Admonitions be good here? https://docusaurus.io/docs/next/markdown-features/admonitions

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 tried. Doesn't support Admonitions.
How to change it?

Copy link
Contributor

Choose a reason for hiding this comment

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

The apisix-website repo supports admonitions. It should work. In this repo, preview is not available as it cannot be built.

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!

@tao12345666333
Copy link
Member

ping @AlinsRan any update?

@tao12345666333
Copy link
Member

a kind reminder @navendu-pottekkat @tokers @juzhiyuan @hf400159

@juzhiyuan
Copy link
Member

a kind reminder @navendu-pottekkat @tokers @juzhiyuan @hf400159

@tao12345666333 Please help to check if the guide is correct except for Style. @navendu-pottekkat and I are discussing Doc Maintainers Program, and for this PR, if the contents are correct we could merge first.

@tao12345666333
Copy link
Member

The guide is correct.

I have approved it before

@tao12345666333
Copy link
Member

One of our current problems is that we don't have enough approvers.

So I need your help.

@juzhiyuan
Copy link
Member

Just checked, and LGTM.

@tao12345666333 tao12345666333 merged commit f63a29f into apache:master May 11, 2022
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

8 participants