Skip to content

Commit 6db5909

Browse files
committed
Finish pulling out unison-credentials as a separate package
1 parent c0156f8 commit 6db5909

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

lib/unison-credentials/package.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ dependencies:
88
- base
99
- aeson
1010
- containers
11+
- filepath
1112
- jose
1213
- text
1314
- base64-bytestring
1415
- lens
16+
- lock-file
1517
- memory
1618
- network-uri
1719
- time
20+
- transformers
1821
- unison-core1
1922
- unison-prelude
20-
- lock-file
23+
- unliftio
2124

2225
library:
2326
source-dirs: src
@@ -44,6 +47,7 @@ default-extensions:
4447
- LambdaCase
4548
- MultiParamTypeClasses
4649
- NamedFieldPuns
50+
- OverloadedRecordDot
4751
- OverloadedStrings
4852
- PatternSynonyms
4953
- RankNTypes

lib/unison-credentials/unison-credentials.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ library
4242
LambdaCase
4343
MultiParamTypeClasses
4444
NamedFieldPuns
45+
OverloadedRecordDot
4546
OverloadedStrings
4647
PatternSynonyms
4748
RankNTypes
@@ -57,13 +58,16 @@ library
5758
, base
5859
, base64-bytestring
5960
, containers
61+
, filepath
6062
, jose
6163
, lens
6264
, lock-file
6365
, memory
6466
, network-uri
6567
, text
6668
, time
69+
, transformers
6770
, unison-core1
6871
, unison-prelude
72+
, unliftio
6973
default-language: Haskell2010

parser-typechecker/package.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ library:
3636
- mtl
3737
- murmur-hash
3838
- mutable-containers
39-
- network-uri
4039
- nonempty-containers
4140
- pretty-simple
4241
- regex-tdfa
4342
- semialign
44-
- servant-client
4543
- stm
4644
- text
4745
- these

parser-typechecker/src/Unison/Codebase/SqliteCodebase/Migrations.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import Text.Printf (printf)
1414
import U.Codebase.Reference qualified as C.Reference
1515
import U.Codebase.Sqlite.DbId (HashVersion (..), SchemaVersion (..))
1616
import U.Codebase.Sqlite.Queries qualified as Q
17-
import Unison.Auth.CredentialManager (getOrCreatePersonalKey)
1817
import Unison.Codebase (CodebasePath)
1918
import Unison.Codebase.Init (BackupStrategy (..), VacuumStrategy (..))
2019
import Unison.Codebase.Init.OpenCodebaseError (OpenCodebaseError (OpenCodebaseUnknownSchemaVersion))
@@ -42,6 +41,8 @@ import Unison.Sqlite.Connection qualified as Sqlite.Connection
4241
import Unison.Util.Monoid (foldMapM)
4342
import Unison.Util.Pretty qualified as Pretty
4443
import UnliftIO qualified
44+
import Unison.Auth.CredentialManager qualified as CredMan
45+
import Unison.Auth.PersonalKey qualified as PK
4546

4647
-- | Mapping from schema version to the migration required to get there.
4748
-- E.g. The migration at index 2 must be run on a codebase at version 1.
@@ -161,7 +162,8 @@ ensureCodebaseIsUpToDate localOrRemote root getDeclType termBuffer declBuffer sh
161162

162163
Region.displayConsoleRegions do
163164
(`UnliftIO.finally` finalizeRegion) do
164-
getOrCreatePersonalKey
165+
credMan <- CredMan.newCredentialManager
166+
keyThumbprint <- PK.personalKeyThumbprint <$> CredMan.getOrCreatePersonalKey credMan
165167
let migs = migrations keyThumbprint regionVar getDeclType termBuffer declBuffer root
166168
-- The highest schema that this ucm knows how to migrate to.
167169
let highestKnownSchemaVersion = fst . head $ Map.toDescList migs

parser-typechecker/unison-parser-typechecker.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,10 @@ library
220220
, mtl
221221
, murmur-hash
222222
, mutable-containers
223-
, network-uri
224223
, nonempty-containers
225224
, pretty-simple
226225
, regex-tdfa
227226
, semialign
228-
, servant-client
229227
, stm
230228
, text
231229
, these

unison-cli/package.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ library:
2121
- ansi-terminal
2222
- attoparsec
2323
- base
24-
- base64-bytestring
2524
- bytestring
2625
- cmark
2726
- co-log-core
@@ -47,10 +46,8 @@ library:
4746
- http-client >= 0.7.6
4847
- http-client-tls
4948
- http-types
50-
- jose
5149
- ki
5250
- lens
53-
- lock-file
5451
- lsp >= 2.2.0.0
5552
- lsp-types >= 2.0.2.0
5653
- megaparsec
@@ -87,6 +84,7 @@ library:
8784
- unison-codebase-sqlite-hashing-v2
8885
- unison-core
8986
- unison-core1
87+
- unison-credentials
9088
- unison-hash
9189
- unison-merge
9290
- unison-parser-typechecker

unison-cli/unison-cli.cabal

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ library
218218
, ansi-terminal
219219
, attoparsec
220220
, base
221-
, base64-bytestring
222221
, bytestring
223222
, cmark
224223
, co-log-core
@@ -244,10 +243,8 @@ library
244243
, http-client >=0.7.6
245244
, http-client-tls
246245
, http-types
247-
, jose
248246
, ki
249247
, lens
250-
, lock-file
251248
, lsp >=2.2.0.0
252249
, lsp-types >=2.0.2.0
253250
, megaparsec
@@ -284,6 +281,7 @@ library
284281
, unison-codebase-sqlite-hashing-v2
285282
, unison-core
286283
, unison-core1
284+
, unison-credentials
287285
, unison-hash
288286
, unison-merge
289287
, unison-parser-typechecker

0 commit comments

Comments
 (0)