/
Al
/
TESamples
Обзор
Документация
Войти
/
Al
/
TESamples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
apps/spring/token-exchange-lib/src/main/java/com/tokenexchange/lib/TokenExchangeRequest.java
48 строк
2 KB
Al
Initial Commit
11 май 2026, 17:40
11 май 2026, 17:40
0a04577
Код
Авторство
О чём код?
package com.tokenexchange.lib; /** * RFC 8693 token-exchange request parameters (subset used by TokenExchangeClient). * * <p>Single-TE-at-edge pattern (REQUIREMENTS §1.1.1, FR-01.7) — the BFF builds this * once per user request and never repeats further down the chain. */ public record TokenExchangeRequest( String subjectToken, String subjectTokenType, String actorToken, String actorTokenType, String requestedTokenType, String audience, String scope ) { public static final String TYPE_ACCESS_TOKEN = "urn:ietf:params:oauth:token-type:access_token"; public static final String TYPE_ID_TOKEN = "urn:ietf:params:oauth:token-type:id_token"; public static Builder builder() { return new Builder(); } public static final class Builder { private String subjectToken; private String subjectTokenType = TYPE_ACCESS_TOKEN; private String actorToken; private String actorTokenType = TYPE_ACCESS_TOKEN; private String requestedTokenType = TYPE_ACCESS_TOKEN; private String audience; private String scope; public Builder subjectToken(String v) { this.subjectToken = v; return this; } public Builder subjectTokenType(String v) { this.subjectTokenType = v; return this; } public Builder actorToken(String v) { this.actorToken = v; return this; } public Builder actorTokenType(String v) { this.actorTokenType = v; return this; } public Builder requestedTokenType(String v) { this.requestedTokenType = v; return this; } public Builder audience(String v) { this.audience = v; return this; } public Builder scope(String v) { this.scope = v; return this; } public TokenExchangeRequest build() { return new TokenExchangeRequest( subjectToken, subjectTokenType, actorToken, actorTokenType, requestedTokenType, audience, scope ); } } }