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

如何通过api调用的方式调用portal service的接口,实现登录,创建app呢? #4234

Closed
ccccaoxin opened this issue Feb 18, 2022 · 18 comments
Labels
area/portal apollo-portal kind/question Categorizes issue when someone want to know answer of a question stale

Comments

@ccccaoxin
Copy link

我尝试接入ldap后,能否可以通过api调用portal的接口实现登录,创建app等呢?

@nobodyiam
Copy link
Member

I suppose it is possible as the login is simply a post request.

image

@Anilople Anilople added area/portal apollo-portal kind/question Categorizes issue when someone want to know answer of a question labels Feb 26, 2022
@huayaoyue6
Copy link

在openapi的地方开一个创建应用的api也是可以的,微调一下权限和client即可。

@nobodyiam
Copy link
Member

@huayaoyue6

Currently, there is no create app permission for open API, do you have any suggestion on that?

@huayaoyue6
Copy link

看错了,场景不一样。我的场景是需要在另外一个项目中初始化的项目的相关信息。所以需要在apollo里创建应用。内容属于openapi的范畴。

@ccccaoxin
Copy link
Author

看错了,场景不一样。我的场景是需要在另外一个项目中初始化的项目的相关信息。所以需要在apollo里创建应用。内容属于openapi的范畴。

目前openapi并不会提供创建app的接口,要么是在openapi使用一个系统超级管理员的账号二次开发出几个接口可以支持app的自动化创建流程

@ccccaoxin
Copy link
Author

@nobodyiam 目前我会使用账号密码请求portal service 的登录接口,使用登录成功的cookie去请求创建app,授权等一系列接口来实现devops流程,可以探讨下这样的方式在你们看来会有什么疏忽吗?

@nobodyiam
Copy link
Member

@nobodyiam 目前我会使用账号密码请求portal service 的登录接口,使用登录成功的cookie去请求创建app,授权等一系列接口来实现devops流程,可以探讨下这样的方式在你们看来会有什么疏忽吗?

This looks okay to me.

@huayaoyue6
Copy link

使用openapi的方式我是这样处理的:

1.在 AppController 中添加一个方法,内容基本与下面的方法保持一致:

public App create(@Valid @RequestBody AppModel appModel) {

2. 在系统配置中添加一个配置,用于标明哪些consumerid可以有创建应用的权限。
3. 在 ConsumerPermissionValidator 添加检测consumer是否有创建应用的权限的方法。
4. 调整client,添加创建应用的方法。

@nobodyiam
Copy link
Member

在系统配置中添加一个配置,用于标明哪些consumerid可以有创建应用的权限

这个目前是一个白名单配置吧,我的建议是最好能复用目前的 role-permission 模型。
看上去我们可以复用类似『系统权限管理』页面的思路来为 consumer 赋予创建应用的权限?

image

@huayaoyue6
Copy link

我们是有的项目是自动创建的,有的项目手工创建的,没办法统一。所以不能复用这个配置。

@nobodyiam
Copy link
Member

我是指我们可以用类似的思路在开放平台授权管理页面里面对 consumer 赋予创建 app 的权限,这样就可以复用权限校验模型了

@huayaoyue6
Copy link

👍

@stale
Copy link

stale bot commented Apr 13, 2022

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 13, 2022
@stale
Copy link

stale bot commented Apr 20, 2022

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Apr 20, 2022
@Anilople
Copy link
Contributor

我是指我们可以用类似的思路在开放平台授权管理页面里面对 consumer 赋予创建 app 的权限,这样就可以复用权限校验模型了

方案1

面向用户的UI,设计成

image

后端的实现复用已有的openapi体系

这个改造量感觉比较小一些

方案2

portal新增1个管理端口,与原先的openapi体系隔离,专门供公司内部的系统使用

改造量比较大,但是隔离性会高一些

方案3

是否为了满足各大公司定制化portal的需求,模仿 eureka server 的使用方式

用户引入@EnableApolloPortal即可让自己的spring boot变成1个apollo portal,再定制化开发自己需要的功能?

改造量巨大,从长远来看既可以满足用户定制化的需求,也可以解决用户定制化portal后,由于改造过多,难以同步升级社区新版本的烦恼。可以降低用户个性化定制后的维护成本


针对这个issue,方案1更适合一些?

@Anilople Anilople reopened this Jul 30, 2023
@stale stale bot removed the stale label Jul 30, 2023
@nobodyiam
Copy link
Member

  1. 方案 1 可行
  2. 方案 2 成本比较高,适用场景比较少
  3. 方案 3 很有意思,如果能实现将大大扩展 apollo 的适用场景

@stale
Copy link

stale bot commented Sep 3, 2023

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 3, 2023
@stale
Copy link

stale bot commented Sep 11, 2023

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/portal apollo-portal kind/question Categorizes issue when someone want to know answer of a question stale
Projects
None yet
Development

No branches or pull requests

4 participants