Skip to content

Commit 450af1d

Browse files
committed
🎨增加授权信息开放接口
1 parent 7a83c23 commit 450af1d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

  • server/projects/main/apps/authen

server/projects/main/apps/authen/api_urls/v1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
from django.urls import path
1515

1616
# 项目内 import
17-
from apps.authen.apis import v1
17+
from apps.authen.apis import v1, v3
1818

1919
# 前缀/api/authen/
2020
urlpatterns = [
2121
path("urlauth/", v1.ProxyServerAuthenticationAPIView.as_view(), name="apiv1_authen_urlauth"),
22+
path("scmallaccounts/", v3.ScmAllAcountListApiView.as_view.as_view(), name="apiv1_all_scm_accounts"),
2223
]

server/projects/main/apps/authen/apis/v3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,11 @@ def get(self, request):
247247
user = self.request.user
248248
accounts = models.ScmAccount.objects.filter(user=user).order_by("-id")
249249
sshs = models.ScmSshInfo.objects.filter(user=user).order_by("-id")
250+
oauths = models.ScmAuthInfo.objects.filter(user).order_by("-id")
250251
return Response({
251252
"ssh": ScmSshInfoSerializer(sshs, many=True).data,
252253
"account": ScmAccountSerializer(accounts, many=True).data,
254+
"oauth": ScmAuthInfoSerializer(oauths, many=True).data
253255
})
254256

255257

0 commit comments

Comments
 (0)