Skip to content

Commit 16f5eee

Browse files
feat: add ETH Archive Service diagram
1 parent 8352c3f commit 16f5eee

File tree

1 file changed

+60
-56
lines changed

1 file changed

+60
-56
lines changed

β€Žauth.md

+60-56
Original file line numberDiff line numberDiff line change
@@ -122,48 +122,55 @@ sequenceDiagram
122122

123123
## Option C (Proposal Swen)
124124

125-
### Initial thoughts
125+
### Initial thoughts and running environment
126126

127127
**Ingestor**
128128

129129
- can run anywhere
130-
- therefore, it cannot contain any secret
131-
- needs to talk to SciCat and Archiver Service API
132-
- needs to be authorised with a user token
130+
- as a central service
131+
- as a desktop application
132+
- it cannot contain any secret (e.g. service account for SciCat)
133+
- app must be authorised by the user
133134

134135
**User**
135136

136-
- does not want to log in all the time
137-
- is only interested in starting a job
137+
- does not want to log in all the time (single sign-on preferred)
138+
- is only interested in _starting_ a job, e.g.
138139
- archive data
139140
- unarchive data
140-
- his authentication token can time out
141+
- the user's authentication token can time out
142+
- the job itself needs to be able to report when its done, independently of the user
141143

142144
**SciCat**
143145

144146
- only accepts authenticated requests
147+
- currently only SciCat tokens
148+
- Service Accounts
145149
- issues its own SciCat tokens (JWT with HS256 algorithm, aka Β«self signedΒ»)
146150
- after a user has successfully logged in to Keycloak
147-
- currently only accepts SciCat tokens
148-
- so it acts as an authority instance
151+
- acts as an authority instance
149152
- offers a self-made mechanism to check if a SciCat token is valid
150153

151-
**Archiver Service**
154+
**ETHZ Archiver Service**
152155

153156
- only accepts authenticated requests
154-
- issues Keycloak service tokens (JWT with RS256, public key signed)
155-
- currently only accepts JWT tokens issued and signed by Keycloak
157+
- JWT RS256 tokens issued and signed by Keycloak
158+
- JWT HS256 tokens issued by SciCat
159+
- can issue a Ingester token for a valid SciCat token
160+
- has service account for SciCat
161+
- must be able to report the status of a dataset any time to SciCat
156162

157-
### What needs to be done
163+
### Use-case: User archives data (MinIO S3 Storage)
158164

159-
- Archiver Service
160-
- needs to be able to accept SciCat πŸ”‘ as well (see ScopeMArchiver#146)
161-
- needs to be able to create valid SciCat πŸ”‘ (variant A)
162-
- SciCat
163-
- can exchange Ingestor JWT πŸ”‘ for Ingestor SciCat πŸ”‘ (variant B)
164-
- accepts all JWT πŸ”‘ issued and signed by Keycloak (variants C+D)
165+
**Notes**:
165166

166-
**Note**: the diagram below does not yet include any authorisation information. It only includes authentication. In future we would like to use JWT πŸ”‘ that contain authorisation information, e.g. tokens for every dataset upload.
167+
- the diagram below does not include any authorisation information, only authentication.
168+
- In future we would like to use JWT πŸ”‘ that contain authorisation information, e.g. tokens for every dataset upload.
169+
- ETH uses MinIO S3 instead of Globus
170+
- the ETHZ Archiver Service has service accounts:
171+
- for S3 to get pre-signed URLs for data upload
172+
- for SciCat to report when the archiving of a dataset has finished
173+
- PSI needs a similar service to ensure reporting back to SciCat
167174

168175

169176
```mermaid
@@ -172,46 +179,43 @@ sequenceDiagram
172179
participant B as Browser
173180
participant S as Scicat Backend
174181
participant I as Ingestor Service
175-
participant G as Storage (Globus)
176182
participant A as ETHZ Archiver Service
183+
participant M as MinIO S3 Storage
177184
participant K as Keycloak
178185
179-
B -) S: Access
186+
Note over B, K: Authorise User
187+
B -) S: request access
180188
S -) K: User Login (redirect)
181-
K --) S: User JWTπŸ”‘
182-
S ->> S: Exchange User JWT πŸ”‘ for SciCat πŸ”‘
183-
S --) B: User SciCat πŸ”‘
184-
B --) I: User SciCat πŸ”‘
185-
I --) A: User SciCat πŸ”‘
186-
alt tbd. ScopeMArchiver issue 146
187-
A -) S: verify + request User info (User SciCat πŸ”‘)
188-
S -) A: OK + User info
189-
end
190-
A -) K: request Ingestor JWT πŸ”‘ (user/pw)
191-
K --) A: Ingestor JWT πŸ”‘
192-
A --) I: Ingestor JWT πŸ”‘
193-
I ->> I: store refresh-token of Ingestor JWT πŸ”‘
194-
I -) A: request S3 credentials (Ingestor JWT πŸ”‘)
195-
A --) I: S3 credentials
196-
I ->> I: upload to S3 ⏳
197-
I -) A: report S3 upload finished (Ingestor JWT πŸ”‘)
198-
199-
alt Variant A: Archiver can create Ingestor SciCat πŸ”‘
200-
A -) S: request Ingestor SciCat πŸ”‘ (secret/Basic Auth)
201-
S --) A: Ingestor SciCat πŸ”‘
202-
A --) I: Ingestor SciCat πŸ”‘
203-
I -) S: report dataset upload finished (Ingestor SciCat πŸ”‘)
204-
else Variant B: SciCat exchanges Ingestor JWT πŸ”‘ for SciCat πŸ”‘
205-
I -) S: request Ingestor SciCat πŸ”‘ (Ingestor JWT πŸ”‘)
206-
S ->> S: Exchange Ingestor JWT πŸ”‘ for SciCat πŸ”‘
207-
S --) I: Ingestor SciCat πŸ”‘
208-
I -) S: report dataset upload finished (Ingestor SciCat πŸ”‘)
209-
else Variant C: SciCat accepts Ingestor JWT πŸ”‘
210-
I -) S: report archiving finished (Ingestor JWT πŸ”‘)
211-
else Variant D: Archiver report directly back to SciCat
212-
A ->> A: store Ingestor JWT πŸ”‘
213-
A ->> A: wait until upload is finished ⏳
214-
A -) S: report archiving finshed (Ingestor JWT πŸ”‘)
189+
K -) S: User JWTπŸ”‘
190+
S ->> S: Exchange User JWT πŸ”‘ β€”> User SciCat πŸ”‘
191+
S -) B: User SciCat πŸ”‘
192+
193+
Note over B, K: ETH Archiver Service<br/>Authorise Ingestor
194+
B -) I: provide User SciCat πŸ”‘ via Cookie
195+
I -) A: request /token<br/>User SciCat πŸ”‘
196+
A -) S: verify + request User info (User SciCat πŸ”‘)
197+
S -) A: OK + User info πŸ“œ
198+
A -) K: request Ingestor JWT πŸ”‘ (Keycloak Service Account πŸ”‘)
199+
K -) A: Ingestor JWT πŸ”‘ + refresh πŸ”‘
200+
A -) I: Ingestor JWT πŸ”‘ + refresh πŸ”‘
201+
202+
Note over I, K: Get presigned S3 URLs for upload
203+
I -) A: request S3 URLs (Ingestor JWT πŸ”‘)
204+
A -) M: request S3 URLs (MinIO πŸ”‘)
205+
M -) A: S3 URLs πŸ”‘
206+
A -) I: S3 URLs πŸ”‘
207+
208+
Note over I, K: Upload data (refresh tokens)
209+
I -) M: upload data (S3 URLs πŸ”‘) ⏳
210+
loop renew Ingestor JWT πŸ”‘ if needed
211+
I -) K: request Ingestor JWT (refresh πŸ”‘)
212+
K -) I: new Ingestor JWT πŸ”‘ + refresh πŸ”‘
215213
end
216214
215+
Note over S, M: Report upload finished
216+
217+
I -) A: report data upload to MinIO finished (Ingestor JWT πŸ”‘)
218+
A -) M: finish upload workflow
219+
A -) S: report archiving finished (Service Account πŸ”‘)
220+
217221
```

0 commit comments

Comments
Β (0)