Commit graph

9903 commits

Author SHA1 Message Date
Eelco Dolstra
a48c2e3411
Merge pull request #2434 from grahamc/graham-improve-upgrade
Upgrade docs: improve the upgrade command
2018-09-19 21:53:50 +02:00
Anders Riutta
1915862767
Upgrade docs: improve the upgrade command
and make it more copy-pastable.
2018-09-19 14:17:06 -04:00
Eelco Dolstra
43b7eebfab
Merge pull request #2433 from grahamc/doc-shebang-quotes
Document that nix-shell's shebang requires double quotes for expressions
2018-09-19 20:08:45 +02:00
Graham Christensen
be9e356e61
nix-shell: document double quotes being necessary for a simple Nix expression in the shebang 2018-09-19 13:01:27 -04:00
Graham Christensen
10a7f19937
nix-shell: explain the merging property close to the example 2018-09-19 12:48:08 -04:00
Luke Clifton
1241a58975 Look inside the user profile 2018-09-19 15:22:39 +08:00
Eelco Dolstra
2ca6ef0fec
Merge pull request #2428 from grahamc/docs-aliases
Document Aliases
2018-09-18 20:24:24 +02:00
Graham Christensen
0cd863197b
docs: document deprecated aliases 2018-09-18 12:23:32 -04:00
Eelco Dolstra
52f6d541b9
nix-env: Fix segfault if -f argument is not a directory or a Nix expression
Fixes #2425.
2018-09-17 16:36:30 +02:00
Eelco Dolstra
901dfc7978
Fix build failure if parallel xz is not available 2018-09-17 16:36:11 +02:00
Vincent Ambo
8d918e48eb refactor(desktop): Don't launch EXWM via Emacs client
Launch EXWM directly in Emacs, instead of first launching an Emacs
server and connecting a client.

In cases where Emacs does not start correctly due to initialisation
errors the error message would never become visible without this change.
2018-09-16 16:57:33 +02:00
Vincent Ambo
754b487ee4 feat(adho): Add Dublin wifi networks 2018-09-16 16:51:20 +02:00
Abseil Team
8ff1374008 Export of internal Abseil changes.
--
821196cfb2a3b943ffdc4c9e75daec92d7ffb28b by Abseil Team <absl-team@google.com>:

Performance improvements

PiperOrigin-RevId: 212668992

--
704858e2e767016bad27d53eec01d9d48e546b23 by Abseil Team <absl-team@google.com>:

Low-level Portability enchancements for Abseil Mutex on WebAssembly.

Emscripten Pthreads do not use signals, so remove use of pthread_sigmask or
other async-signal-safe related handling code.

PiperOrigin-RevId: 212527958

--
be3e38cb4d493b755132d20c8c2d1a51e45d5449 by Jon Cohen <cohenjon@google.com>:

Internal change.

PiperOrigin-RevId: 212523797
GitOrigin-RevId: 821196cfb2a3b943ffdc4c9e75daec92d7ffb28b
Change-Id: I5694e23e4e09364a15dd6fc4e2e3f15e38835687
2018-09-13 13:24:44 -04:00
Eelco Dolstra
8327a7a8fa
Merge branch 'dirOf-relative' of https://github.com/lheckemann/nix 2018-09-13 14:33:12 +02:00
Daniel Høyer Iversen
58a5714009
Merge pull request #206 from clach04/patch-2
readme typo
2018-09-13 07:31:51 +02:00
Abseil Team
02451914b9 Export of internal Abseil changes.
--
74c1330e29f1501f2738258faf9ec4564395c90a by Gennadiy Civil <misterg@google.com>:

Merging https://github.com/abseil/abseil-cpp/pull/166

PiperOrigin-RevId: 212487256

--
4ac236574ff8fb3cc1125505292b0bd8c8192da9 by Abseil Team <absl-team@google.com>:

Allow c_move to take rvalue containers.

PiperOrigin-RevId: 212458618

--
ce94e23984870db666d4c91623ae45b3c60b5b61 by Matt Armstrong <marmstrong@google.com>:

Internal change.

PiperOrigin-RevId: 212153041

--
7d88d286821c5839934756dd63a704ed162c49cb by Chris Kennelly <ckennelly@google.com>:

Internal change

PiperOrigin-RevId: 211982309

--
ddae814b3f609948c20551ea3d80bf51b973f480 by Abseil Team <absl-team@google.com>:

Remove unused argument from InlinedVector's AllocatorAndTag

This is not part of InlinedVector's public interface.

PiperOrigin-RevId: 211973017

--
051fbfd81648a8da66c62c6603af63038d709c15 by Abseil Team <absl-team@google.com>:

Minor performance fix

PiperOrigin-RevId: 211820453

--
c205cb2add7400bc8caf2131cb700eea560b7dbf by Laramie Leavitt <lar@google.com>:

Make absl::Span a tiny bit more consistent.

Add constexper to equivalent absl::Span members as described by
http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0122r7.pdf

* Span constructor use consistently delegate to Span(ptr, length)
* Mark more member methods as constexpr.
* Use data() and size() consistently in member methods.

PiperOrigin-RevId: 211707244

--
55500c9e941f2f58f4a95c121f32772408866eee by Derek Mauro <dmauro@google.com>:

Stop catching polymorphic exception types by value.
GCC 8 emits a warning for this.

PiperOrigin-RevId: 211684466
GitOrigin-RevId: 74c1330e29f1501f2738258faf9ec4564395c90a
Change-Id: Iceab4a5b30ee35d82ef494830262ad29c028cb0a
2018-09-11 14:28:55 -04:00
Gennadiy Civil
921fd5cf02
Merge pull request #166 from rongjiecomputer/cmake-test
[CMake] Only include test targets if ABSL_RUN_TESTS=ON
2018-09-11 14:23:04 -04:00
Gennadiy Civil
411b3c56d9
Update AbseilHelpers.cmake
Comment change
2018-09-11 13:53:48 -04:00
Graham Christensen
0aca1ffb6e Prefer 'remote builder' over 'slave' 2018-09-10 18:57:46 +02:00
Eelco Dolstra
5b2fdfdca2
Merge pull request #2412 from dingxiangfei2009/patch-repl-autoargs
nix repl respects --arg and --argstr
2018-09-10 10:50:51 +02:00
Ding Xiang Fei
d6ac762bf7 auto args on repl 2018-09-10 15:43:17 +08:00
Eelco Dolstra
bba3f0a308
If fallback is enabled, temporarily disable substituters after a failure
Otherwise, we just keep asking the substituter for other .narinfo
files, which can take a very long time due to retries/timeouts.
2018-09-07 17:08:43 +02:00
Eelco Dolstra
33c3f91885
Handle queryPathInfo() failure from substituters when fallback is enabled
Fixes #1990.
2018-09-07 16:35:48 +02:00
Eelco Dolstra
91405986f4
Convert NIX_COUNT_CALLS to JSON too 2018-09-05 21:57:54 +02:00
Eelco Dolstra
0a2545f95c
Log stats to stderr
We shouldn't pollute stdout.
2018-09-05 21:35:58 +02:00
Eelco Dolstra
c4ba5f4be9
Merge branch 'improve-stats' of https://github.com/cleverca22/nix 2018-09-05 21:28:05 +02:00
Eelco Dolstra
2d91012754
fetchurl: Respect unpack
Fixes #2393.
2018-09-05 21:22:37 +02:00
Abseil Team
fb462224c0 Export of internal Abseil changes.
--
86b1c997fac1f77b0eacfab788659b5a89a6096e by Abseil Team <absl-team@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 211654320

--
299b70e1247df768454a76eb957a184de9706f61 by Chris Kennelly <ckennelly@google.com>:

Avoid creating a misaligned reference to int.

PiperOrigin-RevId: 211505883

--
c8fad4357ad0bfb3c5ad197c505509bc087072c9 by Abseil Team <absl-team@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 211458539

--
0613feffcd36466c3e53a50758d7e8f17c001dce by Greg Falcon <gfalcon@google.com>:

Refactor a string unit test into a template function for internal purposes.

PiperOrigin-RevId: 211100748
GitOrigin-RevId: 86b1c997fac1f77b0eacfab788659b5a89a6096e
Change-Id: Ic6a932b6c27c6762dcdb3b0127f1e2be782418c1
2018-09-05 15:21:18 -04:00
Eelco Dolstra
e0ddabb0d6
Merge pull request #2400 from matthewbauer/patch-9
Get effective user in Nix commands
2018-09-05 13:28:23 +02:00
Matthew Bauer
74f6d8767d Get effective user in Nix commands
‘geteuid’ gives us the user that the command is being run as,
including in setuid modes. By using geteuid to determind id, we can
avoid the ‘sudo -i’ hack when upgrading Nix. So now, upgrading Nix on
macOS is as simple as:

$ sudo nix-channel --update
$ sudo nix-env -u

$ sudo launchctl stop org.nixos.nix-daemon
$ sudo launchctl start org.nixos.nix-daemon
or
$ sudo systemctl restart nix-daemon
2018-09-04 19:32:39 -05:00
Loo Rong Jie
d2e5ae5a1a [CMake] Only include test targets if ABSL_RUN_TESTS=ON 2018-09-05 08:25:36 +08:00
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
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