Skip to content

Commit 47a27ad

Browse files
Add release notes
[ci] Signed-off-by: Robert Autenrieth <[email protected]>
1 parent 079d5dd commit 47a27ad

File tree

8 files changed

+108
-62
lines changed

8 files changed

+108
-62
lines changed

apps/app/src/main/scala/org/lfdecentralizedtrust/splice/console/SvAppReference.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ abstract class SvAppReference(
9999
@Help.Summary("Get the CometBFT node dump")
100100
def cometBftNodeDebugDump(): definitions.CometBftNodeDumpResponse =
101101
consoleEnvironment.run {
102-
httpCommand(HttpSvPublicAppClient.GetCometBftNodeDump())
102+
httpCommand(HttpSvOperatorAppClient.GetCometBftNodeDump())
103103
}
104104

105105
@Help.Summary("Make a CometBFT Json RPC request")
@@ -385,7 +385,7 @@ class SvAppBackendReference(
385385
@Help.Summary("Get the CometBFT node debug dump")
386386
def cometBftNodeDump(): definitions.CometBftNodeDumpResponse =
387387
consoleEnvironment.run {
388-
httpCommand(HttpSvPublicAppClient.GetCometBftNodeDump())
388+
httpCommand(HttpSvOperatorAppClient.GetCometBftNodeDump())
389389
}
390390

391391
@Help.Summary("Get the sequencer node status")

apps/sv/src/main/openapi/sv-internal.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ paths:
119119
/v0/admin/domain/cometbft/debug:
120120
get:
121121
tags: [sv]
122-
x-jvm-package: sv_public
122+
x-jvm-package: sv_operator
123123
operationId: "getCometBftNodeDebugDump"
124124
responses:
125125
"200":

apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/SvApp.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ class SvApp(
551551
clock,
552552
localSynchronizerNode,
553553
retryProvider,
554+
cometBftClient,
554555
packageVersionSupport,
555556
timeouts,
556557
loggerFactory,

apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/admin/api/client/commands/HttpSvOperatorAppClient.scala

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,35 @@ object HttpSvOperatorAppClient {
372372
SpliceStatus.fromHttpNodeStatus(SpliceStatus.fromHttp)(response)
373373
}
374374
}
375+
376+
case class GetCometBftNodeDump()
377+
extends BaseCommand[
378+
http.GetCometBftNodeDebugDumpResponse,
379+
definitions.CometBftNodeDumpResponse,
380+
] {
381+
382+
override def submitRequest(
383+
client: Client,
384+
headers: List[HttpHeader],
385+
): EitherT[Future, Either[Throwable, HttpResponse], http.GetCometBftNodeDebugDumpResponse] =
386+
client.getCometBftNodeDebugDump(
387+
headers = headers
388+
)
389+
390+
override def handleOk()(implicit
391+
decoder: TemplateJsonDecoder
392+
): PartialFunction[
393+
http.GetCometBftNodeDebugDumpResponse,
394+
Either[String, definitions.CometBftNodeDumpResponse],
395+
] = {
396+
case http.GetCometBftNodeDebugDumpResponse.OK(
397+
definitions.CometBftNodeDumpOrErrorResponse.members.CometBftNodeDumpResponse(response)
398+
) =>
399+
Right(response)
400+
case http.GetCometBftNodeDebugDumpResponse.OK(
401+
definitions.CometBftNodeDumpOrErrorResponse.members.ErrorResponse(response)
402+
) =>
403+
Left(response.error)
404+
}
405+
}
375406
}

apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/admin/api/client/commands/HttpSvPublicAppClient.scala

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -424,35 +424,4 @@ object HttpSvPublicAppClient {
424424
}
425425
}
426426

427-
case class GetCometBftNodeDump()
428-
extends BaseCommandPublic[
429-
http.GetCometBftNodeDebugDumpResponse,
430-
definitions.CometBftNodeDumpResponse,
431-
] {
432-
433-
override def submitRequest(
434-
client: Client,
435-
headers: List[HttpHeader],
436-
): EitherT[Future, Either[Throwable, HttpResponse], http.GetCometBftNodeDebugDumpResponse] =
437-
client.getCometBftNodeDebugDump(
438-
headers = headers
439-
)
440-
441-
override def handleOk()(implicit
442-
decoder: TemplateJsonDecoder
443-
): PartialFunction[
444-
http.GetCometBftNodeDebugDumpResponse,
445-
Either[String, definitions.CometBftNodeDumpResponse],
446-
] = {
447-
case http.GetCometBftNodeDebugDumpResponse.OK(
448-
definitions.CometBftNodeDumpOrErrorResponse.members.CometBftNodeDumpResponse(response)
449-
) =>
450-
Right(response)
451-
case http.GetCometBftNodeDebugDumpResponse.OK(
452-
definitions.CometBftNodeDumpOrErrorResponse.members.ErrorResponse(response)
453-
) =>
454-
Left(response.error)
455-
}
456-
}
457-
458427
}

apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/admin/http/HttpSvOperatorHandler.scala

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.lfdecentralizedtrust.splice.http.{
3535
import org.lfdecentralizedtrust.splice.scan.admin.api.client.ScanConnection
3636
import org.lfdecentralizedtrust.splice.scan.config.ScanAppClientConfig
3737
import org.lfdecentralizedtrust.splice.store.{ActiveVotesStore, AppStore, AppStoreWithIngestion}
38+
import org.lfdecentralizedtrust.splice.sv.cometbft.CometBftClient
3839
import org.lfdecentralizedtrust.splice.sv.config.SvAppBackendConfig
3940
import org.lfdecentralizedtrust.splice.sv.store.{SvDsoStore, SvSvStore}
4041
import org.lfdecentralizedtrust.splice.sv.util.SvUtil.generateRandomOnboardingSecret
@@ -52,6 +53,7 @@ class HttpSvOperatorHandler(
5253
clock: Clock,
5354
localSynchronizerNode: Option[LocalSynchronizerNode],
5455
retryProvider: RetryProvider,
56+
cometBftClient: Option[CometBftClient],
5557
override protected val packageVersionSupport: PackageVersionSupport,
5658
override protected val timeouts: ProcessingTimeout,
5759
protected val loggerFactory: NamedLoggerFactory,
@@ -429,6 +431,40 @@ class HttpSvOperatorHandler(
429431
.map(r0.FeatureSupportResponseOK(_))
430432
}
431433

434+
override def getCometBftNodeDebugDump(
435+
respond: r0.GetCometBftNodeDebugDumpResponse.type
436+
)()(extracted: ActAsKnownUserRequest): Future[
437+
r0.GetCometBftNodeDebugDumpResponse
438+
] = {
439+
implicit val ActAsKnownUserRequest(traceContext) = extracted
440+
withSpan(s"$workflowId.getCometBftNodeDebugDump") { _ => _ =>
441+
withClientOrNotFound(respond.NotFound) { client =>
442+
client
443+
.nodeDebugDump()
444+
.map(response =>
445+
definitions.CometBftNodeDumpOrErrorResponse(
446+
definitions.CometBftNodeDumpResponse(
447+
status = response.status,
448+
networkInfo = response.networkInfo,
449+
abciInfo = response.abciInfo,
450+
validators = response.validators,
451+
)
452+
)
453+
)
454+
}
455+
}
456+
}
457+
458+
private def withClientOrNotFound[T](
459+
notFound: definitions.ErrorResponse => T
460+
)(call: CometBftClient => Future[T]) = cometBftClient
461+
.fold {
462+
notFound(definitions.ErrorResponse("CometBFT is not configured."))
463+
.pure[Future]
464+
} {
465+
call
466+
}
467+
432468
private def withSequencerConnectionOrNotFound[T](
433469
notFound: definitions.ErrorResponse => T
434470
)(call: SequencerAdminConnection => Future[T]) = localSynchronizerNode

apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/admin/http/HttpSvPublicHandler.scala

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -438,34 +438,6 @@ class HttpSvPublicHandler(
438438
}
439439
}
440440

441-
/** Intended use: Interacting with CometBFT node monitoring/debugging/testing purposes
442-
*
443-
* Protection: Endpoint is protected by IP allowlisting
444-
*/
445-
override def getCometBftNodeDebugDump(
446-
respond: r0.GetCometBftNodeDebugDumpResponse.type
447-
)()(extracted: TraceContext): Future[
448-
r0.GetCometBftNodeDebugDumpResponse
449-
] = {
450-
implicit val traceContext: TraceContext = extracted
451-
withSpan(s"$workflowId.getCometBftNodeDebugDump") { _ => _ =>
452-
withClientOrNotFound(respond.NotFound) { client =>
453-
client
454-
.nodeDebugDump()
455-
.map(response =>
456-
definitions.CometBftNodeDumpOrErrorResponse(
457-
definitions.CometBftNodeDumpResponse(
458-
status = response.status,
459-
networkInfo = response.networkInfo,
460-
abciInfo = response.abciInfo,
461-
validators = response.validators,
462-
)
463-
)
464-
)
465-
}
466-
}
467-
}
468-
469441
/** Intended use: Used by other SV operators
470442
*
471443
* Protection: Endpoint is protected by IP allowlisting

docs/src/release_notes.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,43 @@ Release Notes
1111
0.4.20
1212
------
1313

14+
- API security
15+
16+
- Tightened authorization checks for all non-public API endpoints.
17+
18+
All non-public endpoints now properly respect the current user rights
19+
defined in the participant user management service.
20+
Revoking user rights on the participant will revoke access to the corresponding API endpoints.
21+
22+
In general, endpoints that required authentication before will now check that the authenticated user
23+
is not deactivated on the participant has has ``actAs`` rights for the relevant party
24+
(wallet party for the wallet app API, SV operator party for the SV app API, etc).
25+
26+
- Administrative SV app endpoints now require participant admin rights.
27+
28+
The following SV app endpoints now require the user to have participant admin rights in
29+
the participant user management service. This allows for finer grained access control
30+
where users with ``actAs`` rights for the SV operator party but without participant admin
31+
rights may use the SV or wallet UIs, but may not perform administrative actions like
32+
hard synchronizer migrations.
33+
34+
- ``/v0/admin/domain/pause``
35+
- ``/v0/admin/domain/unpause``
36+
- ``/v0/admin/domain/migration-dump``
37+
- ``/v0/admin/domain/migration-dump``
38+
- ``/v0/admin/domain/identities-dump``
39+
- ``/v0/admin/domain/data-snapshot``
40+
41+
Note that only the service users of the SV and validator apps should automatically have participant admin rights.
42+
If you are using other users to access the above endpoints, check their rights.
43+
44+
- Some endpoints will have changed authorization rules in an upcoming release.
45+
46+
- SV app ``/v0/dso`` is currently public, but will require authorization as SV operator,
47+
similar to most other SV app endpoints.
48+
Use the corresponding public endpoint in the scan app if you need to fetch DSO info.
49+
50+
1451
- Deployment
1552

1653
- Fix a bug where the setting the affinity for the ``splice-cometbft`` and ``splice-global-domain`` helm charts would remove the anti affinity for the ``cometbft`` and the ``sequencer`` deployment. This ensures that if multiple SVs are run on the same nodes, not more than one ``cometbft`` pod can be deployed on the same node and that no more than one ``sequencer`` pod can be deployed to the same node (a ``cometbft`` pod can still share a node with a ``sequencer`` pod). This can be disabled by setting the ``enableAntiAffinity`` helm value to ``false`` (default ``true``).

0 commit comments

Comments
 (0)