common/keys.aug diagrams
OpenID Connect login application
Project overview · Compiled explanation
Class interactions
Mermaid source
flowchart TD
n0["MemorySigningKeys"]
n1["SigningKeys"]
n2["initializeKeys"]
n3["Crypto"]
n0 -->|"implements"| n1
n2 -->|"calls configure; depends on"| n1
n2 -->|"calls generateRsa; depends on"| n3
Sequences
Call arrows identify checked targets; loop and branch frames determine when they run. Open that target’s module to follow its implementation. Branches describe alternatives; loops describe repeated work. Native calls and interface dispatch stop at their declared contracts. Exit notes end that path; enclosing recovery and cleanup remain visible.
KeyError constructor
It implements Error.
SigningKeys.configure
It takes provider and session as RsaPrivateKey.
It can call SigningKeys.configure. Failures can raise KeyError.
May leave with checked errors: KeyError. Interface contract; implementation selected at runtime. Explanation.
SigningKeys.provider
It returns RsaPrivateKey. It can call SigningKeys.provider. Failures can raise KeyError.
May leave with checked errors: KeyError. Interface contract; implementation selected at runtime. Explanation.
SigningKeys.session
It returns RsaPrivateKey. It can call SigningKeys.session. Failures can raise KeyError.
May leave with checked errors: KeyError. Interface contract; implementation selected at runtime. Explanation.
MemorySigningKeys constructor
It implements SigningKeys.
The read-only, private field _keys has type Shared<Map<string,RsaPrivateKey>> and starts as a Shared with value from an empty map from string to RsaPrivateKey.
Mermaid source
sequenceDiagram
participant p0 as MemorySigningKeys constructor
participant p1 as Shared
p0->>p0: Map‹string, RsaPrivateKey›()
p0-->>p0: Map result: Map‹string, RsaPrivateKey›
p0->>p1: Shared(value=Map result)
p1-->>p0: _keys: Shared‹Map‹string, RsaPrivateKey››
MemorySigningKeys.configure
It takes provider and session as RsaPrivateKey.
It can call SigningKeys.configure. Failures can raise KeyError.
Mermaid source
sequenceDiagram
participant p0 as MemorySigningKeys.configure
rect rgb(245, 240, 241)
Note over p0: Enter lock scope
p0->>p0: keys.length()
p0-->>p0: length result: int
alt the number of elements in keys does not equal 0
p0->>p0: KeyError() · construct value
p0-->>p0: KeyError result: KeyError
Note over p0: Raise checked failure KeyError(); required cleanup runs<br/>before exit
end
p0->>p0: keys.set(key=”provider”, value=provider)
p0->>p0: keys.set(key=”session”, value=session)
Note over p0: Leave lock scope
end
Note over p0: May leave with checked errors: KeyError
MemorySigningKeys.provider
It can call SigningKeys.provider. Failures can raise KeyError.
Mermaid source
sequenceDiagram
participant p0 as MemorySigningKeys.provider
rect rgb(245, 240, 241)
Note over p0: Enter lock scope
p0->>p0: keys.get(key=”provider”)
p0-->>p0: get result: optional RsaPrivateKey
alt Match when null:
p0->>p0: KeyError() · construct value
p0-->>p0: KeyError result: KeyError
Note over p0: Raise checked failure KeyError(); required cleanup runs<br/>before exit
else Match when some key:
Note over p0: Return key; required cleanup runs before exit
end
Note over p0: Leave lock scope
end
Note over p0: May leave with checked errors: KeyError
MemorySigningKeys.session
It can call SigningKeys.session. Failures can raise KeyError.
Mermaid source
sequenceDiagram
participant p0 as MemorySigningKeys.session
rect rgb(245, 240, 241)
Note over p0: Enter lock scope
p0->>p0: keys.get(key=”session”)
p0-->>p0: get result: optional RsaPrivateKey
alt Match when null:
p0->>p0: KeyError() · construct value
p0-->>p0: KeyError result: KeyError
Note over p0: Raise checked failure KeyError(); required cleanup runs<br/>before exit
else Match when some key:
Note over p0: Return key; required cleanup runs before exit
end
Note over p0: Leave lock scope
end
Note over p0: May leave with checked errors: KeyError
initializeKeys
It gets crypto (Crypto) and keys (SigningKeys) from dependency injection.
It can call Crypto.generateRsa and SigningKeys.configure. Failures can raise CryptoError and KeyError.
Mermaid source
sequenceDiagram
participant p0 as initializeKeys
participant p1 as crypto: Crypto
participant p2 as keys: SigningKeys
p0->>p1: generateRsa() · interface dispatch
p1-->>p0: provider: RsaPrivateKey
p0->>p1: generateRsa() · interface dispatch
p1-->>p0: session: RsaPrivateKey
p0->>p2: configure(provider=provider, session=session) ·<br/>interface dispatch
Note over p0: May leave with checked errors: CryptoError, KeyError
Called contracts
- KeyError — common/keys.aug
- SigningKeys — common/keys.aug
- SigningKeys.configure — common/keys.aug
- Crypto — package/@git/url_9ef654c66d34ab8f5527@0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug
- Crypto.generateRsa — package/@git/url_9ef654c66d34ab8f5527@0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug