Commit graph

12391 commits

Author SHA1 Message Date
Vincent Ambo
5eefd71bf1 chore: Add repository URL to Cargo manifest 2018-09-04 14:56:06 +02:00
Vincent Ambo
5cb7dd7ca0 feat(build): Configure Travis CI builds 2018-09-04 14:50:58 +02:00
Vincent Ambo
0c3cdee5ee chore: Make JWKS type Cloneable 2018-09-04 14:40:41 +02:00
Adrián Medraño Calvo
6978c1f45c Restack X-Windows after being mapped to ensure EnterNotify events fire
* exwm-manage.el (exwm-manage--on-MapNotify, exwm-manage--init):
Restack X windows after being mapped in order to ensure they receive
an EnterNotify event (does not happen under XQuartz).
2018-09-04 12:00:00 +00:00
Adrián Medraño Calvo
ac1372eb11 Command for toggling debugging output
* exwm-core.el (exwm-debug-toggle): New function for toggling
debugging output.
(exwm-mode-map): Use it.
2018-09-04 12:00:00 +00:00
Adrián Medraño Calvo
3419337f52 Substitute overlapping keybindings
* exwm-core.el (exwm-mode-map): Change keybindings to avoid
overlap.
2018-09-04 12:00:00 +00:00
Adrián Medraño Calvo
74ef19ff44 Use XELB's debugging facilities
* exwm-debug.el: Move to XELB as `xcb-debug'.
* exwm-core.el (exwm--log): Use it.
(exwm--log): Support switching debugging output at runtime.
2018-09-04 12:00:00 +00:00
Vincent Ambo
64a480ccb7 fix: validate() does not require ownership of the token string
Thanks to @bvs for pointing this out.
2018-09-04 13:01:14 +02:00
Vincent Ambo
89af12444a chore: License under GPL-3.0-or-later 2018-09-04 12:48:11 +02:00
Vincent Ambo
29dfb6826f docs: Update README to match new library API 2018-09-04 12:48:11 +02:00
Vincent Ambo
dd527ecdf1 feat: Implement claim validation
Implements initial validations of token claims. The included
validations are:

* validation of token issuer
* validation of token audience
* validation that a subject is set
* validation that a token is not expired
2018-09-04 12:45:27 +02:00
Vincent Ambo
ae409995ca fix: Handle warning about unused kty & alg fields
These fields are only used to constrain deserialisation to the
supported values, but have no further effect.

`rustc` throws warnings about them not being used, which this commit
disables.
2018-09-04 12:45:27 +02:00
Vincent Ambo
5f8f252f68 test: Ensure library doctest compiles & runs correctly 2018-09-04 12:45:27 +02:00
Vincent Ambo
7c99220723 refactor: Pass 'String' to token_kid instead of internal type 2018-09-04 12:45:27 +02:00
Vincent Ambo
b6eedbfe16 feat: Initial implementation of 'validate' function
Implements the logic for validating a token signature and returning
its decoded headers and claims.

This does not yet apply claim validations, as those have not been
specified yet.
2018-09-04 12:45:27 +02:00
Vincent Ambo
37652545b4 feat: Introduce ValidJWT type to represent validated & decoded JWT
Introduces a new struct type which contains the token's headers and
claims as JSON values. This is constructed by validating a token and
allows library users to deal with the deserialised values as they
please.
2018-09-04 12:45:27 +02:00
Vincent Ambo
b3e8f7a91f refactor: Introduce helper for deserialising token parts
There are multiple points in the code where a token part needs to be
deserialised (i.e. first base64-decoded, then JSON-deserialised). This
is extracted to a helper function in this commit.
2018-09-04 12:45:27 +02:00
Vincent Ambo
33c122f10e feat: Implement extraction of KIDs from unvalidated tokens 2018-09-04 12:45:27 +02:00
Vincent Ambo
5bd7a91d10 test: Add simple test for working JWT validation 2018-09-04 12:45:27 +02:00
Vincent Ambo
4b5dc17fc8 feat: Introduce validation of JWT signatures
Introduces the internal function for validating JWT signatures. The
process is relatively straightforward:

1. Create an OpenSSL signature verifier using the public key from the
   JWK.

2. Split the JWT into the data (header + claims) and signature parts.

3. Validate the data against the signature using the verifier from (1)

OpenSSL "cleanly" returns a boolean in case of an invalid signature,
but an otherwise successful operation.

This is represented differently in the returned error variant, with an
invalid signature being represented as `InvalidSignature`, and other
errors as the `OpenSSL` error variant which wraps the underlying
OpenSSL issue.

Successful validation returns an empty `Ok` result.
2018-09-04 12:45:27 +02:00
Vincent Ambo
17e3a6560a refactor: Move tests to separate file 2018-09-04 12:45:27 +02:00
Vincent Ambo
d3b200e820 refactor: Use error enum + result type alias for failures
This makes the library slightly more "rusty". Instead of returning a
validation result which also represents potential success, use an enum
representing the error variants and the standard library's
`Result`-type to represent success/failure.
2018-09-04 12:45:27 +02:00
Vincent Ambo
0f8231e990 feat: Add initial public API skeleton 2018-09-04 12:45:27 +02:00
Vincent Ambo
d0a52de5e8 docs: Add code of conduct 2018-09-04 12:45:26 +02:00
Vincent Ambo
b916554ac5 docs: Add initial README 2018-09-04 12:45:26 +02:00
Eelco Dolstra
5e0a7206f5
Merge pull request #2397 from dtzWill/fix/reported-dl-size-with-callback
download: fix size reported to progress bar
2018-09-04 12:16:51 +02:00
Will Dietz
28418af920 download: fix size reported to progress bar 2018-09-03 14:12:54 -05:00
Vladimír Čunát
5f3b72cfc2
docs: change expired bzip2.org to archive.org
Fixes #2396.
2018-09-03 17:57:13 +02:00
Michael Bishop
4b034f390c remove the old text format output 2018-09-02 18:25:23 -03:00
Eelco Dolstra
54996b51fb
Bump version 2018-09-02 22:12:00 +02:00
Eelco Dolstra
4dd09210d7
Release notes tweaks 2018-09-02 21:47:10 +02:00
Vincent Ambo
63c08b923f chore(emacs): Bump EXWM version
Includes changes from ch11ng/exwm#477 which may resolve issues with
ch11ng/exwm#425.
2018-09-02 15:21:23 +02:00
Vincent Ambo
1515020dd4 feat(adho): Add additional wifi networks 2018-09-02 15:14:18 +02:00
Vincent Ambo
614375c7b1 feat(adho): Run haveged daemon 2018-09-02 15:14:18 +02:00
Daiderd Jordan
80a4b44d3d
nix doctor: only perform path/profile checks with a daemon/local store
Not all store types LegacySSHStore support these operations and it
doesn't really make sense to check those.
2018-09-02 13:41:55 +02:00
Daiderd Jordan
bfdca55868
nix doctor: add check for profile roots
In most cases profiles that are in PATH should have a gcroot.
2018-09-02 12:56:28 +02:00
Daiderd Jordan
0f18dc5479
nix doctor: add warning for multiple versions
It's pretty easy to unintentionally install a second version of nix
into the user profile when using a daemon install.  In this case it
looks like nix was upgraded while the nix-daemon is probably still
unning an older version.
2018-09-02 12:56:28 +02:00
Daiderd Jordan
246acf93f2
nix doctor: handle serve protocol
The serve protocol used by LegacySSHStore has a different major and
shouldn't be compared to PROTOCOL_VERSION.
2018-09-02 12:54:42 +02:00
Daiderd Jordan
7314dc7f07
nix doctor: add warning if client/daemon protocol mismatches
A protocol mismatch can sometimes cause problems when using specific
features with an older daemon. For example:

Nix 2.0 changed the way files are compied to the store.  The daemon is
backwards compatible and can still handle older clients, however a 1.11
nix-daemon isn't forwards compatible.
2018-09-02 12:54:39 +02:00
Daiderd Jordan
070823baa4
Store: expose the protocol version used by a store 2018-09-02 12:54:29 +02:00
Daiderd Jordan
c9a08540c3
nix doctor: add command
Inspired by the homebrew command, shows a combination of debugging
information and warnings with potential issues with a nix installation.
2018-09-02 12:54:20 +02:00
James Ferguson
dd57c5eebb Explicitly specify frame for cursor warping conditional 2018-09-02 16:18:06 +08:00
James Ferguson
2399a0bb22 Fix cursor warping conditional for cursor left of frame 2018-09-02 16:18:06 +08:00
Michael Bishop
2fd1008c70 add JSON to NIX_SHOW_STATS 2018-09-01 20:05:06 -03:00
Eelco Dolstra
1f49926601
Merge pull request #2388 from grahamc/graham/document-multi-user
Document multi-user installation, and add release notes about it not being the default on 2.1
2018-09-01 22:43:48 +02:00
Michael Bishop
c29e5fbb13 improve the stats when profiling 2018-09-01 17:11:56 -03:00
Graham Christensen
c42eaaf684
Create upgrade notes 2018-09-01 15:35:46 -04:00
Eelco Dolstra
c5ab07ec2b
Merge pull request #2168 from grahamc/explain-why-netrc-is-busted
manual: document why ~/.netrc doesn't work
2018-09-01 21:25:04 +02:00
Eelco Dolstra
51003f892d
Merge pull request #2309 from symphorien/disallowed-man
add manual entries for disallowedRequisites and disallowedReferences
2018-09-01 21:01:41 +02:00
Eelco Dolstra
291f67aecf
Merge pull request #2237 from nh2/patch-1
manual: distributed-builds: Mention - as default
2018-09-01 20:41:49 +02:00