我正在使用 NSwag 生成 TypeScript 客户端(Angular 格式),但由于循环依赖关系,我在实现不记名令牌身份验证时遇到问题。
我的用户服务需要导入 TS 客户端才能使用令牌 DTO,而我的 TS 客户端需要导入用户服务才能注入令牌。
因此,我想知道是否可以将生成的文件拆分为两个(或更多)客户端和模型文件。
另一种选择是在 HTTP 请求上实现拦截器,但我发现这令人厌恶,因为如果我使用其他 API,它可能会导致问题。
我的团队目前正在开发一个应用程序,以使用 Admin SDK 在 GCP 中列出我公司的域用户,以用于入职和离职目的。
我们使用服务帐户来执行此操作,并且已admin.directory.user.readonly在 Google 管理员的高级设置中添加了范围。Admin SDK API 已激活,我们可以在 Credentials 区域中看到服务帐户。
当我们使用参数和 调用https://www.googleapis.com/admin/directory/v1/usersviewType=domain_public端点并使用oauth2ldomain=[our domain]生成的访问令牌时,我们会收到以下消息:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Not Authorized to access this resource/api"
}
],
"code": 403,
"message": "Not Authorized to access this resource/api"
}
}
Run Code Online (Sandbox Code Playgroud)
是否存在我们没有预见到的任何域限制?
google-api service-accounts google-admin-sdk google-directory-api google-cloud-platform