Skip to content

Commit 21785f2

Browse files
ATL-7040: Delete DID based authentication
This commit deletes the legacy DID based authentication
1 parent e2499fa commit 21785f2

39 files changed

+6
-2515
lines changed

node/src/main/protobuf/common_models.proto

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ option java_package = "io.iohk.atala.prism.protos";
55

66
package io.iohk.atala.prism.protos;
77

8-
import "status.proto";
98
import "google/protobuf/timestamp.proto";
109

1110
/**
@@ -68,17 +67,3 @@ enum OperationStatus {
6867
CONFIRMED_AND_APPLIED = 3; // The operation has been successfully applied to the PRISM.
6968
CONFIRMED_AND_REJECTED = 4; // The operation has been processed by PRISM, but rejected because of some error.
7069
}
71-
72-
message AtalaErrorMessage {
73-
google.rpc.Status status = 1;
74-
}
75-
76-
message AtalaMessage {
77-
oneof message {
78-
AtalaErrorMessage atala_error_message = 9;
79-
}
80-
}
81-
82-
message ConnectionsStatusRequest {
83-
repeated string connection_tokens = 1;
84-
}

node/src/main/protobuf/node_api.proto

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -72,70 +72,6 @@ service NodeService {
7272
rpc ScheduleOperations(ScheduleOperationsRequest) returns (ScheduleOperationsResponse) {}
7373
}
7474

75-
service NodeExplorerService {
76-
/**
77-
* WHITELISTED_DID
78-
*
79-
* Return a list of scheduled but unconfirmed operations.
80-
*/
81-
rpc GetScheduledOperations(GetScheduledOperationsRequest) returns (GetScheduledOperationsResponse) {}
82-
83-
/**
84-
* WHITELISTED_DID
85-
*
86-
* Return a list of wallet transactions.
87-
*/
88-
rpc GetWalletTransactionsPaginated(GetWalletTransactionsRequest) returns (GetWalletTransactionsResponse) {}
89-
90-
/**
91-
* WHITELISTED_DID
92-
*
93-
* Return the Node Wallet Balance
94-
*/
95-
rpc GetWalletBalance(GetWalletBalanceRequest) returns (GetWalletBalanceResponse) {}
96-
97-
/**
98-
* WHITELISTED_DID
99-
*
100-
* Retrieves list of available metrics.
101-
*/
102-
rpc GetAvailableMetrics(GetAvailableMetricsRequest) returns (GetAvailableMetricsResponse) {}
103-
104-
/**
105-
* WHITELISTED_DID
106-
*
107-
* Get statistics
108-
*/
109-
rpc GetNodeStatistics(GetNodeStatisticsRequest) returns (GetNodeStatisticsResponse) {}
110-
}
111-
112-
/**
113-
* Retrieve statistics from the Node.
114-
*/
115-
message GetNodeStatisticsRequest {
116-
repeated string metrics = 1;
117-
}
118-
119-
/**
120-
* Statistics from the Node.
121-
*/
122-
message GetNodeStatisticsResponse {
123-
repeated double metrics = 1;
124-
}
125-
126-
/**
127-
* Request to find metrics exposed by Node.
128-
* See NodeService.GetAvailableMetrics for more information.
129-
*/
130-
message GetAvailableMetricsRequest {}
131-
132-
/**
133-
* Response with a list of metrics exposed by Node.
134-
* See NodeService.GetAvailableMetrics for more information.
135-
*/
136-
message GetAvailableMetricsResponse {
137-
repeated string metrics = 1;
138-
}
13975

14076
/**
14177
* Request to find a DID Document.
@@ -242,51 +178,7 @@ message ScheduleOperationsResponse {
242178
repeated OperationOutput outputs = 1;
243179
}
244180

245-
/**
246-
* Request to retrieve all scheduled but not confirmed Atala operations.
247-
*/
248-
message GetScheduledOperationsRequest {
249-
/**
250-
* Operations of which type should be returned.
251-
*/
252-
OperationType operationsType = 1;
253181

254-
enum OperationType {
255-
AnyOperationType = 0; // Any operation
256-
CreateDidOperationOperationType = 1;
257-
UpdateDidOperationOperationType = 2;
258-
ProtocolVersionUpdateOperationType = 5;
259-
}
260-
}
261-
262-
message GetScheduledOperationsResponse {
263-
repeated SignedAtalaOperation scheduled_operations = 1; // a list of scheduled operations
264-
}
265-
266-
/**
267-
* Request to retrieve wallet transactions, either ongoing or confirmed.
268-
* Pagination included.
269-
*/
270-
message GetWalletTransactionsRequest {
271-
TransactionState state = 1; // Transaction state: either ongoing or confirmed
272-
string last_seen_transaction_id = 2; // Last seen transaction id
273-
int32 limit = 3; // The maximum number of transactions to return; must be greater than 0.
274-
275-
enum TransactionState {
276-
Ongoing = 0; // Transactions which hasn't been confirmed by Prism Node
277-
Confirmed = 1; // Transactions which ahs been confirmed by Prism Node
278-
}
279-
}
280-
281-
message GetWalletTransactionsResponse {
282-
repeated TransactionInfo transactions = 1;
283-
}
284-
285-
message GetWalletBalanceRequest {
286-
}
287-
message GetWalletBalanceResponse {
288-
bytes balance = 1;
289-
}
290182

291183
// Used to encode the responses of the operations issued in an AtalaBlock.
292184
message OperationOutput {

node/src/main/protobuf/status.proto

Lines changed: 0 additions & 47 deletions
This file was deleted.

node/src/main/resources/application.conf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ didIdCharLenLimit = ${?NODE_ID_CHAR_LIMIT}
6868
trustedProposerSuffix = "7476322b05901e9ebfb1ffa2bdfcfc819549f757474f0278ca4bb9d182a553db"
6969
trustedProposerSuffix = ${?TRUSTED_PROPOSER_SUFFIX}
7070

71-
nodeExplorer {
72-
whitelistDids = [
73-
"did:prism:106c458b95e57e16cbbd4b9566a52446c39949fdbd8cd8f876230ff243cf7b5a:Cj8KPRI7CgdtYXN0ZXIwEAFKLgoJc2VjcDI1NmsxEiEDVw1B_oShVvJ11AlVhLYv7OBO9sY9AOz8D5FoWoqI14c"
74-
]
75-
whitelistDids += ${?NODE_EXPLORER_WHITELIST_DID}
76-
}
77-
7871
# CardanoLedgerService
7972
cardano {
8073
# Network connecting to, options: testnet, mainnet

node/src/main/resources/db/migration/V1__create_tables.sql

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ CREATE TABLE public.did_data
9696
);
9797

9898

99-
CREATE TABLE public.did_request_nonces
100-
(
101-
request_nonce BYTEA NOT NULL,
102-
did public.did NOT NULL,
103-
CONSTRAINT did_request_nonces_pk PRIMARY KEY (request_nonce,
104-
did)
105-
);
106-
107-
10899
CREATE TABLE public.key_values
109100
(
110101
"key" varchar(64) NOT NULL,

node/src/main/scala/io/iohk/atala/prism/node/NodeApp.scala

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import cats.implicits.toFunctorOps
66
import com.typesafe.config.{Config, ConfigFactory}
77
import doobie.hikari.HikariTransactor
88
import io.grpc.{Server, ServerBuilder}
9-
import io.iohk.atala.prism.node.auth.WhitelistedAuthenticatorF
10-
import io.iohk.atala.prism.node.auth.grpc.{GrpcAuthenticatorInterceptor, TraceExposeInterceptor, TraceReadInterceptor}
11-
import io.iohk.atala.prism.node.auth.utils.DidWhitelistLoader
12-
import io.iohk.atala.prism.node.identity.PrismDid
139
import io.iohk.atala.prism.node.logging.TraceId
1410
import io.iohk.atala.prism.node.logging.TraceId.IOWithTraceIdContext
1511
import io.iohk.atala.prism.node.metrics.UptimeReporter
@@ -52,7 +48,6 @@ class NodeApp(executionContext: ExecutionContext) { self =>
5248
private def start(): Resource[IO, (SubmissionSchedulingService, Server)] = {
5349
for {
5450
globalConfig <- loadConfig()
55-
nodeExplorerDids = loadNodeExplorerDids(globalConfig)
5651
_ <- startMetrics(globalConfig)
5752
databaseConfig = TransactorFactory.transactorConfig(globalConfig)
5853
_ = applyDatabaseMigrations(databaseConfig)
@@ -125,24 +120,13 @@ class NodeApp(executionContext: ExecutionContext) { self =>
125120
),
126121
submissionService
127122
)
128-
metricsCountersRepository <- MetricsCountersRepository.resource(liftedTransactor, logs)
129123
nodeService <- NodeService.resource(
130124
didDataRepository,
131125
objectManagementService,
132126
logs
133127
)
134-
nodeStatisticsService <- StatisticsService.resource(atalaOperationsRepository, metricsCountersRepository, logs)
135-
nodeExplorerService <- NodeExplorerService.resource(ledger, objectManagementService, logs)
136-
requestNoncesRepo <- RequestNoncesRepository.resource(liftedTransactor, logs)
137-
authenticator <- WhitelistedAuthenticatorF.resource(new NodeExplorerAuthenticator(requestNoncesRepo), logs)
138-
nodeExplorerGrpcService = new NodeExplorerGrpcServiceImpl(
139-
authenticator,
140-
nodeExplorerService,
141-
nodeStatisticsService,
142-
nodeExplorerDids
143-
)
144128
nodeGrpcService = new NodeGrpcServiceImpl(nodeService)
145-
server <- startServer(nodeGrpcService, nodeExplorerGrpcService)
129+
server <- startServer(nodeGrpcService)
146130
} yield (submissionSchedulingService, server)
147131
}
148132

@@ -157,21 +141,6 @@ class NodeApp(executionContext: ExecutionContext) { self =>
157141
ConfigFactory.load()
158142
}
159143

160-
private def loadNodeExplorerDids(config: Config): Set[PrismDid] = {
161-
logger.info("Loading DID whitelist")
162-
val didWhitelist = DidWhitelistLoader.load(config, "nodeExplorer")
163-
if (didWhitelist.isEmpty) {
164-
logger.warn(
165-
s"DID whitelist is empty, which makes explorer methods inaccessible"
166-
)
167-
} else {
168-
logger.info(
169-
s"DID whitelist:\n${didWhitelist.map(_.value).map("- " + _).mkString("\n")}"
170-
)
171-
}
172-
didWhitelist
173-
}
174-
175144
private def initializeCardano(
176145
keyValueService: KeyValueService[IOWithTraceIdContext],
177146
globalConfig: Config,
@@ -247,19 +216,14 @@ class NodeApp(executionContext: ExecutionContext) { self =>
247216
}
248217

249218
private def startServer(
250-
nodeService: NodeGrpcServiceImpl,
251-
nodeExplorerService: NodeExplorerGrpcServiceImpl
219+
nodeService: NodeGrpcServiceImpl
252220
): Resource[IO, Server] =
253221
Resource.make[IO, Server](IO {
254222
logger.info("Starting server")
255223
import io.grpc.protobuf.services.ProtoReflectionService
256224
val server = ServerBuilder
257225
.forPort(NodeApp.port)
258-
.intercept(new TraceExposeInterceptor)
259-
.intercept(new TraceReadInterceptor)
260-
.intercept(new GrpcAuthenticatorInterceptor)
261226
.addService(NodeServiceGrpc.bindService(nodeService, executionContext))
262-
.addService(NodeExplorerServiceGrpc.bindService(nodeExplorerService, executionContext))
263227
.addService(
264228
_root_.grpc.health.v1.health.HealthGrpc
265229
.bindService(new HealthService, executionContext)

node/src/main/scala/io/iohk/atala/prism/node/NodeExplorerAuthenticator.scala

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)