Граф коммитов

130 Коммитов

Автор SHA1 Сообщение Дата
microsoft-github-policy-service[bot] 76bf797e4c
Microsoft mandatory file (#146)
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
2022-10-24 14:46:21 -07:00
peterbom b78d82385a Reduce default output width when listing certificates (#132)
When running `sestest list-certificates`, the friendly name takes up a lot of horizontal space, causing lines to wrap and making the output hard to read.

This change defaults to displaying only the DNS name, but allowing an `extra-columns` argument for specifying that subject and/or friendly names should also be displayed.

This also addresses the point raised in #130 that it should be easy to see certificates by DNS name so that it should be easy to scan for, e.g. localhost.
2019-02-28 11:52:49 +13:00
peterbom 75ad9da767 Remove duplicates when running sestest list-certificates (#131)
The output of `sestest list-certificates` currently displays the same certificate multiple times (if it appears in multiple stores/locations).

These changes ensure certificates are only listed once.
2019-02-27 10:50:05 +13:00
peterbom dadf4fbd1a Enhance sestest list-certificates to display certificates appropriate for server authentication (#130)
`sestest` already supports `forsigning` and `forencryption` arguments to `list-certificates`, as well as grouping the output, to easily identify certificates which can be used for signing and encryption.

When running `sestest server` we also require another kind of certificate, i.e. that which can be used for server authentication (to enable clients to communicate via TLS). Identifying certificates which are appropriate for this involves selecting ones which:
- **If** the certificate has an enhanced key usage extension, the usages must include server authentication (OID 1.3.6.1.5.5.7.3.1). Without this the test server will throw an `InvalidOperationException` ("Certificate XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX cannot be used as an SSL server certificate. It has an Extended Key Usage extension but the usages do not include Server Authentication (OID 1.3.6.1.5.5.7.3.1)").
- (optionally) are trusted (and whose certificate chain can be validated).
- have a DNS name which matches the hostname by which requests will be made to the server (probably `localhost`)

This addresses the first two of these by allowing a `forserverauth` argument to `list-certificates`, and displaying two extra sections in the output: one for certificates suitable for server authentication that _can_ be verified, and one for those that can't.
2019-02-27 10:40:50 +13:00
peterbom a4a9f67ad8 Implement leasing API in test server (#125)
* move handlers for each of the different API versions into different controller methods

* add controller methods for acquire, renew and release

* change structure of Errorable to allow LINQ query syntax

* use Result<TOk, TError> class for error handling in request handler classes, and re-implement Errorable extension methods on Results

* update documentation with PowerShell/curl/wget commands for testing the leasing API

* respond to ErrorCollection PR comments

* add braces around null check throws

* remove Errorable class (replace with Result/ErrorCollection)

* remove static Errorable class, and instead create Result instances using implicit operators

* rename ErrorCollection to ErrorSet, respond to PR comments in Result class

* API version changes in Server project

* suppress messages about implicit operator alternatives

* add documentation comments to API DTOs

* use DateTimeOffset in preference to DateTime

* change order of generic parameters in Result extension methods to be more readable

* rename generic type parameters and variables for consistency

* use AssertOk and AssertError consistently, without introducing separate variable for result

* rename local function in test

* follow existing pattern for datetime properties on FakeTokenPropertyProvider, and add test for expected errors on provider

* format Assert.Throws to wrap lines

* use ResultCodes property for returning specific result codes

* simplify test assertions for collections
2019-02-22 14:24:39 +13:00
Bevan Arps 871796ab20 Improve listing of available certificates (#120)
List certificates in groups based on potential use
2019-01-25 16:21:06 +13:00
peterbom 7692988a07 Fix errors binding test server to IPv6 address in Linux under Docker (#127) 2019-01-25 15:09:20 +13:00
Bevan Arps cfefa72afd Discussion: an alternative approach to ensuring consistent exception handling (#129)
Catch exception types expected on Linux and handle gracefully
2019-01-25 14:56:09 +13:00
peterbom cc0892da56 Merge from master (#124)
* Add certificates for the sovereign clouds (#106)

* On Windows, work around OpenSSL not hooking into the Windows Automatic Root Certificates Update process. (#112)

* Add retry logic if we experience Curl-related errors

* Allow overriding CURLOPT_CONNECTTIMEOUT via environment variable

* Fix compiler errors for non-windows platform (#122)

* - Wrap WinHttpDeleter structure with _WIN32 macro.
- Use _WIN32 instead of WIN32

* More fixes for compiler errors on non-windows platform:

- Include missing headers ( thread, chrono )
- Wrap EnsureRootCertsArePopulated routine with _WIN32 macro
2019-01-24 14:35:31 +13:00
peterbom bdeeb170f1 upgrade to .net core 2.2 (#126)
The managed projects all currently target dotnet core 2.0. This retargets them to 2.2, as well as updating nuget dependencies to the latest versions.

This also handles a couple of behaviour changes in the latest `System.IdentityModel.Tokens.Jwt` assembly's `ValidateToken` method: [`ValidateIssuerSigningKey` should not `false` if `RequireSignedTokens` is `false`](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/972), and some of the exception messages have changed.
2019-01-24 14:34:33 +13:00
peterbom 0b03b30d82 Renames for consistency with updated terminology (#123)
Much of the existing code refers to 'entitlements' as properties of the token, or attributes which a token gives permission to.

We've agreed to redefine an 'entitlement' as something which is granted upon an API request. The token is used to obtain the entitlement, but the token is not the entitlement.

This updates the code to better reflect that way of thinking.
2018-11-30 08:44:32 +13:00
Peter Bomber ee8e5bb72e fix git command for retrieving short commit identifier 2018-07-24 13:23:00 +10:00
Bevan Arps 6f563a7352 Add use of shell commands to verify a token to the walk-through (#117)
* Document prerequisites for sesclient.native.exe (#114)
* Update documentation to include `publish-archives.ps1`
* Update reference to psake when troubleshooting
* Remove platform option from build script
* Add details on using PowerShell to verify the token
* Add examples for curl and wget
2018-07-24 10:44:06 +12:00
Bevan Arps 914abe4163
Merge pull request #116 from theunrepentantgeek/feature/fix-typos
Minor changes to the build guide
2018-05-07 14:05:32 +12:00
Bevan Arps c9ac39e74b Minor changes to the build guide 2018-05-07 13:37:22 +12:00
Bevan Arps eee6033a78
Update documentation to include `publish-archives.ps1` (#115) 2018-05-04 15:39:46 +12:00
Bevan Arps 25e32ffbc7
Fix typo 2018-05-04 15:38:22 +12:00
Bevan Arps 750048a184 Update documentation to include `publish-archives.ps1` 2018-05-04 14:56:25 +12:00
Bevan Arps d7de6071be
Document prerequisites for sesclient.native.exe (#114) 2018-05-04 14:29:57 +12:00
Bevan Arps b9eac49445
Optionally include vc_redist in the packages for sesclient (#113)
* Include vc_redist in the published archive for sesclient
* Give the URL for download when vc_redist is missing
2018-05-02 14:01:17 +12:00
Bevan Arps a2ef9f5eaa
Compress packages for both x64 and x86 versions of sesclient (#111) 2018-04-27 16:39:33 +12:00
peterbom 04df17173c Fix linking errors in sesclient.native in x86 builds (#110)
* Fix linking errors in sesclient.native in x86 builds
* remove ws2_32.lib from Debug build dependencies
2018-04-26 16:08:00 +12:00
Bevan Arps de7238f7c6
Add certificates for the sovereign clouds 2018-04-24 14:55:00 +12:00
peterbom ba002c5377 Moved sestest specific unit tests to dedicated sestest.Tests project (#108) 2018-04-24 11:21:42 +12:00
peterbom 054fd017cf Revert "Update documentation for API v2 (#77)" (#107)
Note that this does keep some relevant documentation enhancements).
2018-04-24 10:17:37 +12:00
peterbom d46498ffc2
WIP: attempt to consolidate entitlement reading code (#97)
* change NodeEntitlements to take IP Addresses and Application IDs as collections instead of adding one-by-one
build NodeEntitlements in a consistent manner between reading a token and reading from the command line (sestest generate)

* Extract interface from entitlement reading/parsing code, separate entitlement readers into separate JWT parsing and validation classes, and fix up unit
tests.
2018-04-23 14:51:28 +12:00
Bevan Arps 760264eae3 Document the need to handle trailing / on AZ_BATCH_ACCOUNT_URL (#104) 2018-04-19 13:06:11 +12:00
peterbom 971d5da414 Alter 'address' format in token generation command line to be consistent with application IDs (#96) 2018-04-19 13:02:45 +12:00
peterbom 966b849286 Change case of Directory.Build.props so that it's found on case-sensitive file systems (#102) 2018-04-19 13:02:44 +12:00
peterbom e892b6113c Return an error code from sestest verify if verification fails (#101)
* Return an error code from sestest verify if verification fails
2018-04-19 13:02:44 +12:00
peterbom db61df87e6 Adjust sestest token verification code to work with the real batch service as well as the localhost test server (#100) 2018-04-19 13:02:44 +12:00
peterbom f638c97ccf Split token verification into reading (parsing) and verification components (#95)
* refactor token verifier into an entitlement verifier that handles reading NodeEntitlements from a token as well as validating a request associated with that token

* move ErrorableExtensions.Then to Errorable.Bind and break up long token reading method

* added documentation comments

* implement Bind in concrete errorable classes
2018-04-19 13:02:44 +12:00
peterbom c6b9fd86ad Controller code reorganization (#94)
Move server-related classes to the Server project, and slight reorganization of controller code
2018-04-19 13:02:44 +12:00
peterbom 80a997b260 update documentation comments on ErrorableExtensions (#93) 2018-04-19 13:02:44 +12:00
Bevan Arps 0194afcecc Updating NuGet packages to comply with security policy (#91) 2018-04-19 13:02:44 +12:00
Bevan Arps 5c61e9b51f Implement equality for Specifiable (#90)
Implement equality for `Specifiable<T>`, including unit tests
2018-04-19 13:02:43 +12:00
peterbom 81496ca021 Make use of Specifiable when building ServerOptions and NodeEntitlements (#89) 2018-04-19 13:02:43 +12:00
peterbom dd684205fe Removal of ServerOptionBuilderOptions (#86)
Avoid changing the behaviour of ServerOptionBuilder for unit testing by swapping out the CertificateStore dependency for a fake implementation.
2018-04-19 13:02:43 +12:00
Bevan Arps 4e24492af6 Use value from environment variable (#85)
Fixes a bug when specifying the URL in the AZ_BATCH_ACCOUNT_URL where the value specified was ignored.
2018-04-19 13:02:43 +12:00
peterbom 98b01cfa4f Specifiable (#81)
* Added `Specifiable` type for distinguishing between unspecified values and values specified as null.
2018-04-19 13:02:43 +12:00
Bevan Arps 1d4f6a9fdc An alternative approach to avoiding a separate list of errors (#79)
* Add extension methods for Errorable configuration
* Use new extension methods to configure NodeEntitlements etc
2018-04-19 13:02:43 +12:00
Bevan Arps e7b3b22782 Update documentation for API v2 (#77)
* Update docs for new API version
* Improve bootstrap script
2018-04-19 13:02:43 +12:00
Dave Fellows a83bffa62d Fix typo in readme title 2018-04-19 13:01:05 +12:00
Bevan Arps aaa8c6db39 Update SDK to next API version (#75)
* Create base class for commands
* Extract functionality for list-certificates into service class
* Extract functionality for find-certificate into service class
* Extract functionality for generate into service class
* Code Gardening
* Add verify command to check entitlement
* Add expiry to software entitlement response
2018-04-19 13:01:05 +12:00
Bevan Arps 0f5773433a Improve the API for working with Errorable<T> (#74)
* Add extension methods `And()`, `Do()`, and `Map()` on `Errorable<T>`
* Remove `Combine()` and associated tests
2018-04-19 13:01:04 +12:00
Bevan Arps a25e5898a1 Update readme.md 2018-04-19 13:01:04 +12:00
Bevan Arps e8bbd58d6d Document the changes for the next version of the SES API (#62)
* Update REST API for removal of `vmid` and addition of `expiry`
2018-04-19 13:01:04 +12:00
Bevan Arps 562001a7cb Document the need to handle trailing / on AZ_BATCH_ACCOUNT_URL (#104) 2018-04-19 12:58:46 +12:00
Bevan Arps 2e71881091 Fix issues when publishing archives (#105)
* Published builds must be release builds
* Fix issue caused by picking up too many folders when publishing
2018-04-19 12:54:17 +12:00
peterbom 12bc06d62e Fix defect caused by the dotnet CLI first-use welcome prompt polluting command output (#99) 2018-04-19 12:54:05 +12:00