Skip to content

Commit 091f5a5

Browse files
authored
Merge pull request #95 from eclipse-biscuit/push-rvmqtmmomozq
doc: fix outdated references
2 parents 6c10d5a + e1e85fe commit 091f5a5

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

biscuit-servant/src/Auth/Biscuit/Servant.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ import Servant.Server.Experimental.Auth
199199
-- > -- reachable with an admin biscuit
200200
-- > . withFallbackAuthorizer [authorizer|allow if right("anon");|]
201201
-- > -- ^ this policy will be tried /after/ the endpoints policies, so `endpoint3` will
202-
-- > -- *not* be reachable with an anon macaroon.
202+
-- > -- *not* be reachable with a biscuit carrying a @right("anon")@ fact.
203203
-- > handlers = handler1 :<|> handler2 :<|> handler3
204204
-- > in hoistServer @ProtectedAPI Proxy handleAuth handlers
205205
-- > -- ^ this will apply `handleAuth` on all 'ProtectedAPI' endpoints.

biscuit/src/Auth/Biscuit.hs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ module Auth.Biscuit
1212
-- * The biscuit auth token
1313
-- $biscuitOverview
1414

15-
-- * Creating keypairs
15+
-- * Creating key pairs
1616
-- $keypairs
1717
newSecret
1818
, toPublic
1919
, SecretKey
2020
, PublicKey
2121

22-
-- ** Parsing and serializing keypairs
22+
-- ** Parsing and serializing key pairs
2323
, serializeSecretKeyHex
2424
, serializePublicKeyHex
2525
, parseSecretKeyHex
@@ -158,7 +158,7 @@ import Auth.Biscuit.Token (AuthorizedBiscuit (..),
158158
queryAuthorizerFacts,
159159
queryRawBiscuitFacts,
160160
seal, serializeBiscuit)
161-
import Auth.Biscuit.Utils (decodeHex, encodeHex')
161+
import Auth.Biscuit.Utils (decodeHex, encodeHex')
162162
import qualified Data.Text as Text
163163

164164

@@ -178,12 +178,12 @@ import qualified Data.Text as Text
178178
--
179179
-- > -- Biscuit Open Verified means the token has valid signatures
180180
-- > -- and is open to further restriction
181-
-- > buildToken :: Keypair -> IO (Biscuit Open Verified)
182-
-- > buildToken keypair =
181+
-- > buildToken :: SecretKey -> IO (Biscuit Open Verified)
182+
-- > buildToken secret =
183183
-- > -- the logic language has its own syntax, which can be typed directly in haskell
184184
-- > -- source code thanks to QuasiQuotes. The datalog snippets are parsed at compile
185185
-- > -- time, so a datalog error results in a compilation error, not a runtime error
186-
-- > mkBiscuit keypair [block|
186+
-- > mkBiscuit secret [block|
187187
-- > // the two first lines describe facts:
188188
-- > // the token holder is identified as `user_1234`
189189
-- > user("user_1234");
@@ -256,8 +256,8 @@ fromHex = either (fail . Text.unpack) pure . decodeHex
256256
-- Biscuits rely on public key cryptography: biscuits are signed with a secret key only known
257257
-- to the party which emits it. Verifying a biscuit, on the other hand, can be done with a
258258
-- public key that can be widely distributed. A private key and its corresponding public key
259-
-- is called a keypair, but since a public key can be deterministically computed from a
260-
-- private key, owning a private key is the same as owning a keypair.
259+
-- is called a key pair, but since a public key can be deterministically computed from a
260+
-- private key, owning a private key is the same as owning a key pair.
261261

262262
-- | Generate a new random 'SecretKey'
263263
newSecret :: IO SecretKey
@@ -398,11 +398,11 @@ applyThirdPartyBlockB64 b contentsB64 = do
398398
-- they carry are not visible outside themselves, only their checks are evaluated.
399399
--
400400
-- Third-party blocks lift this limitation by carrying an extra signature, crafted with a
401-
-- dedicated keypair. This way, the token authorizer (as well as blocks themselves) can
402-
-- opt-in to trust facts coming from third-party blocks signed with specific keypairs.
401+
-- dedicated key pair. This way, the token authorizer (as well as blocks themselves) can
402+
-- opt-in to trust facts coming from third-party blocks signed with specific key pairs.
403403
--
404404
-- For instance, adding `check if group("admin") trusting {publicKey};` to a token will
405-
-- make it usable only if it carries a third party-block signed by the corresponding keypair,
405+
-- make it usable only if it carries a third party-block signed by the corresponding key pair,
406406
-- and carrying a `group("admin")` fact.
407407
--
408408
-- Since it is not desirable to share the token with the external entity providing the third-party

publish.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
3+
echo -n "Release official package? y/N> "
4+
read CANDIDATE
5+
6+
case "$CANDIDATE" in
7+
y) echo "Releasing official version"; CANDIDATE="--publish";;
8+
*) echo "Releasing candidate version"; CANDIDATE="";;
9+
esac
10+
11+
echo -n "Release version> "
12+
read VERSION
13+
14+
cabal upload "./dist-newstyle/sdist/biscuit-haskell-${VERSION}.tar.gz" ${CANDIDATE}
15+
cabal upload "./dist-newstyle/biscuit-haskell-${VERSION}-docs.tar.gz" --documentation ${CANDIDATE}
16+
cabal upload "./dist-newstyle/sdist/biscuit-servant-${VERSION}.tar.gz" ${CANDIDATE}
17+
cabal upload "./dist-newstyle/biscuit-servant-${VERSION}-docs.tar.gz" --documentation ${CANDIDATE}
18+
# cabal upload -u clementd -P 'pass show hackage' "./dist-newstyle/sdist/biscuit-wai-${VERSION}.tar.gz" ${CANDIDATE}
19+
# cabal upload -u clementd -P 'pass show hackage' "./dist-newstyle/biscuit-wai-${VERSION}-docs.tar.gz" --documentation ${CANDIDATE}

0 commit comments

Comments
 (0)