шлется на реальный сервер (#2)
build-and-deploy / prepare (push) Successful in 0s
build-and-deploy / build-and-push (., Dockerfile, hr-appeals-web) (push) Successful in 8s
Tests / frontend-test (push) Successful in 11s
build-and-deploy / build-and-push (server, server/Dockerfile, hr-appeals-auth) (push) Successful in 4s
build-and-deploy / deploy (push) Successful in 15s

Co-authored-by: Mariya Trishina <trishina.mariya@tnsu.kz>
Reviewed-on: http://git.tnsu.kz/gorbenko.pavel/hr-appeals/pulls/2
This commit was merged in pull request #2.
This commit is contained in:
2026-08-24 08:54:41 +00:00
parent 7f6f42a96b
commit dea024f3a9
23 changed files with 660 additions and 73 deletions
+17 -2
View File
@@ -21,9 +21,24 @@ const REFRESH_MARGIN_MS = 60_000;
let cached: CachedToken | null = null;
function readSecret(path: string): string {
try {
return readFileSync(path, 'utf8');
} catch (cause) {
// Самая частая причина на свежем клоне — файлов просто нет: в git они не
// хранятся. Ошибка ENOENT сама по себе не подсказывает, что делать.
throw new Error(
`Не удалось прочитать ${path}. Сертификат и ключ в git не хранятся — ` +
'положите их в каталог secrets/ (см. secrets/README.md) или укажите ' +
'другой каталог через SECRETS_DIR.',
{ cause }
);
}
}
function buildClientAssertion(): string {
const certificatePem = readFileSync(config.certPath, 'utf8');
const privateKey = readFileSync(config.keyPath, 'utf8');
const certificatePem = readSecret(config.certPath);
const privateKey = readSecret(config.keyPath);
// x5t — SHA-1 отпечаток DER-сертификата, base64url. По нему Azure AD находит
// публичный ключ приложения и проверяет подпись JWT.