This documentation is for a release that is no longer maintained
See documentation for the latest supported version.3.2. 将用户从 GitHub 置备到软件目录
要验证用户,Red Hat Developer Hub 在软件目录中需要存在它们。考虑配置 Developer Hub 以根据调度将用户从 GitHub 置备到软件目录,而不是手动置备用户。
先决条件
您已使用 GitHub 启用身份验证,包括以下 secret:
-
GITHUB_HOST_DOMAIN
-
GITHUB_ORGANIZATION
-
流程
要启用 GitHub 成员发现,请编辑自定义 Developer Hub ConfigMap,如
app-config-rhdh
,并将以下行添加到app-config-rhdh.yaml
内容中:带有强制
github
字段的app-config.yaml
片段Copy to Clipboard Copied! Toggle word wrap Toggle overflow dangerouslyAllowSignInWithoutUserInCatalog: false
- 只允许 Developer Hub 软件目录中存在的用户进行身份验证。
机构
,githubUrl
, 和orgs
- 使用您在 GitHub 中创建并配置了 OpenShift 作为 secret 的 Developer Hub 应用程序信息。
schedule.frequency
- 指定自定义调度频率。支持代码中使用的 cron、ISO 持续时间和"human 持续时间"。
schedule.timeout
- 指定自定义超时。支持代码中使用的 ISO 持续时间和"human duration"。
schedule.initialDelay
- 指定自定义初始延迟。支持代码中使用的 ISO 持续时间和"human duration"。
验证
检查控制台日志,以验证同步是否已完成。
成功同步示例:
{"class":"GithubMultiOrgEntityProvider","level":"info","message":"Reading GitHub users and teams for org: rhdh-dast","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:production:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:58"} {"class":"GithubMultiOrgEntityProvider","level":"info","message":"Read 7 GitHub users and 2 GitHub groups in 0.4 seconds. Committing...","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:production:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:59"}
{"class":"GithubMultiOrgEntityProvider","level":"info","message":"Reading GitHub users and teams for org: rhdh-dast","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:production:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:58"} {"class":"GithubMultiOrgEntityProvider","level":"info","message":"Read 7 GitHub users and 2 GitHub groups in 0.4 seconds. Committing...","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:production:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:59"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 使用 GitHub 帐户登录。