26 Commits

Author SHA1 Message Date
gitasaurus
3c82ff359c [FEAT] Adds support for enterprise audit logs 2023-05-09 10:28:58 -05:00
Chris Simpson
176bf386a0 maint: Tidying up DefineConstants (#2538) 2022-08-12 12:19:26 -05:00
Jose de Jesus Medina
66a6781584 spellcheck round 2 (#2259) 2020-10-06 09:47:36 -03:00
Cédric Luthi
c94cd05b8b Obsolete UnixTimestampExtensions methods (#2121)
* The equivalent of `public static DateTimeOffset FromUnixTime(this long unixTime)` exists in the framework since .NET Framework 4.6: https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset.fromunixtimeseconds
* The equivalent of `public static long ToUnixTime(this DateTimeOffset date)` exists in the framework since .NET Framework 4.6: https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset.tounixtimeseconds
2020-03-03 09:30:30 -04:00
Itai Bar-Haim
5ffc96995f Adding initial support for GitHub Apps. (#1738)
* Added authentication using bearer token.

* Added Installation and AccessToken clients.

* Added new clients to Reactive project

* added support for DateTime serialized as FileTime

* added support for StatusEventPayload

* added support for StatusEventPayload

* Added test for StatusEventPayload and fixed serializer to return that event payload type.

* WIP - added ApplicationClient and related Api Urls.

* Continued implementing Installations support.

* Fixing build (WIP)

* fixed build

* added Account property to Installation. prefer nameof(x) over literal "x".

* fixed according to code review.

* fixed build.

* switched Installation ID from int to long.

* added Permissions and Events properties to Installation.

* added documentation to Application and Installation properties in IGitHubClient.

* wip - added tests to new clients

* wip - fix build

* wip - fixed build.

* added InstallationsClient tests.

* added integration test for InstallationsClient.

* changes requested in code review.

* add Get method for App

* Create GitHubApp response model instead of re-using existing Application response model

* add Get method to observable client

* fixed build (both locally and failed test).

* Fixed documentation and added some missing XML docs.

* added DebuggerDisplay to StatusEventPayload

* updated XML docs and added some missing bits. prefer nameof(x) over literal "x".

* Add xml comments to AccessToken response model and use DateTimeOffset rather than DateTime

* Tidy up XmlComments and make consistent across client and observable client and interfaces

* fixup unit tests to independently verify preview header

* Implement GetInstallation method

* revert commits unrelated to GitHubApps - these can be done on a separate PR if required

* this extra authenticator class doesnt appear to be used anywhere

* undo project file change as it doesnt appear to be necessary

* Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps"

This reverts commit c53cc110b8d807f62fdfeaa7df19e1532d050007, reversing
changes made to 0c9e413d420a4725738644ea5b13af6ec102d456.

* Revert "Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps""

This reverts commit 02d52b8adf814b6945c60cb59a907a8cd34b1ce7.

* add XmlDoc comments to response models and flesh out installation permissions

* name AcceptHeaders member consistently

* accidentally lost changes to Credentials.cs

* Enhance Intergation test framework to handle GitHubApp settings and discoer tests appropriately
Get code ready for GitHubJWT nuget package but for now just hardcode a JWT in ENV VAR
Add 1 integration test for each method and ensure they are working!

* fixed compiler warnings.

* Added support for Installation=>Id field that arrives in a Pull Request Event payload.

(See the last field in the sample JSON of https://developer.github.com/v3/activity/events/types/#pullrequestevent)

* Change integration test project to netcoreapp2.0 so we can use GitHubJwt nuget package in integration tests

* First cut at some GitHubApp doco

* update mkdocs config

* Moved the Installation property to ActivityPayload, so it's available in all payloads.

This feature is not undocumented, unfortunately, but valid:
https://platform.github.community/t/determining-which-installation-an-event-came-from/539/11

* Split Installation to Installation and InstallationId, and added a comfort method for gaining its AccessToken.

* fixed InstallationId CreateAccessToken to receive IGitHubAppsClient. added (and fixed) docs.

* reverted object-oriented style comfort method and it's docs.

* update all test projects to netcoreapp2.0

* tweak build configs to use 2.0.3 SDK

* also need to update cake frosting build to netcoreapp2.0

* tweak docs some more

* fix convention test failures

* test projects still had some old runtime parts in them!

* travis osx image needs to be at least 10.12 for .NET Core 2.0

* shell script might need the same argument tweak for cake

* more doc tweaks

* Make sure compiler warning output isnt somehow causing Linux and OSX builds to fail

* moar logging for linux/OSX builds

* stop sourcelink on linux/OSX builds to see if that is the problem

* set verbosity to detailed for the dotnet build step

* try new sourcelink and list out remotes

* is travis being weird with git clone?

* SourceLink may be defaulting to true on CI server so explicitly set it as false rather than omitting it

* detailed is a bit too verbose for travis, try normal

* turn sourcelink back on for Linux/OSX

* fix compiler warning

* Try SourceLink.Create.CommandLine instead of SourceLink.Create.GitHub

* CliToolReferences did not update to latest versions

* remove debug origin info

* turn off msbuild output

* go back to SourceLink.Create.GitHub!

* time diff between dev PC and API causes issues if specifying a full 600 second token

* handle extra date format that Installation end point now returns

* field needs to be protected in order to be deserialized

* provide even more buffer for client vs server clock drift

* Update to latest GitHubJwt reference

* go back to SDK 1 since SDK 2 is having sporadic travisCI faliures in TestSourceLink build step

* get appveyor working

* update sourcelink back to latest, and use SDK 1.04 (runtime 1.0.5)
2018-04-16 20:42:23 +10:00
Ryan Gribble
41b4059c11 Deserializer should handle nullable StringEnum<T> (#1760)
* add deserializer tests for nullable enums, StringEnum and nullable StringEnum properties

* Fix deserializing nullable structs by using the underlying type when nullable

* StringEnum<T> should behave like an enum, returning default(T) when it is uninitialised/null/blank

* Don't allow null to be passed into StringEnum ctor - if it needs to be null then it should be declared as nullable

* fix expected json

* move logic to determine if property is a StringEnum<T> into helper function

* serializer needs to treat StringEnum<T> specially by serializing the enum value according to existing serializer strategy (parameter attributes and so on)

* remove fallback to default(T)

* add test to assert ctor throws exception when null passed in

* remove test for default(T) fallback behaviour

* Fix exception in serializer test - StringEnum property must be initialized otherwise an exception is thrown when attempting to serialize

* Dont allow empty strings either
2018-02-16 20:12:44 +10:00
Itai Bar-Haim
da3bbe3d0c Added support for DateTime serialized as FileTime (#1735)
* added support for DateTime serialized as FileTime

* changed non-iso timestamp deserialization from FromFileTime to FromUnixTime.

* updated a test to also test the new time stamp deserializer.

* moved all tests projects to a solution folder of their own.

* Fixed test and added a missing field to Account.

* Use original values in test.

* Moved UpdatedAt from Account to User.
2018-01-18 19:23:10 +10:00
Mickaël Derriey
13d5dab516 Port to .NET Core (#1503)
Port to .NET Core
2017-01-21 14:42:02 +10:00
naveen
85e520d5d6 Fixes for mono
removed DocPlagiarizer

Fixed tests

removed unused variable

removed unused variable that was causing the build to fail

fixed the file name casing.

updated the nugget.exe to download System.Net.Http

PCL is required for mono

more fixes for travis
2015-12-11 20:36:47 -05:00
Naveen
fafa5365d1 Fixes for json serialization bug
Fixes for json serialization issue when unicode is present.
2015-12-04 14:20:15 -05:00
Brendan Forster
80719c0033 aaaand format the code 2015-11-04 13:38:51 -08:00
Haacked
eb5d14cfdc Organize usings and remove unused 2015-08-04 21:12:37 -07:00
Haacked
316e456ba2 Add support to SimpleJson for IReadOnlyDictionary
I need to submit a PR for this upstream as well.
2015-01-03 20:21:43 -08:00
Matt G. Ellis
808ffe6081 Add richer extension point for CLR to JSON Name Mapping.
Instead of just considering the name when mapping a CLR member to a
JSON field name, provide a method which gives subclasses the full
MemberInfo object.  This could be used, for example, to query an
attribute on the member to pick up a different name.
2014-11-17 22:49:16 -08:00
Matt G. Ellis
29ae144d8e Removing unessecary call to MapClrMemberNameToJsonFieldName.
The keys in the IDictionary instances in the GetCache are JSON Field
names so the call to MapClrMemberNameToJsonFieldName in
TrySerializeUnknownTypes is unnesecary at best and incorrect at worst
as the input we were passing to that function was not a CLR Member
Name but rather a JSON Field Name.
2014-11-17 22:15:23 -08:00
Matt G. Ellis
c994fffd18 Fix indenting 2014-11-17 22:15:11 -08:00
Haacked
91811330d9 Upgrade Octokit's dependencies 2014-09-05 18:24:18 -07:00
Brendan Forster
f9f2c816bf added hotfix to serialize base classes 2014-03-05 21:49:15 +11:00
Brendan Forster
5a6df4afb4 updated SimpleJson to v0.34 2014-03-05 21:48:42 +11:00
Brendan Forster
12beae7231 workaround for how TypeInfo is terrible 2014-01-23 15:28:13 -08:00
Brendan Forster
09a0ea6c56 updated SimpleJson to 0.30.0 2014-01-23 14:49:35 -08:00
John Nye
d433eec548 Allow deserializing of base properties in SIMPE_JSON_TYPEINFO mode (works otherwise) 2013-11-07 21:28:06 -08:00
Brendan Forster
b3ceb1d661 we should deserialize Urls in a specific way 2013-11-04 17:58:42 +11:00
half-ogre
b437060b7d move reflection stuff to .Internal namespace 2013-10-08 15:16:27 -07:00
Haacked
48b9f663b2 Update SimpleJson to 0.24.0
Also corrected some small mistakes I made earlier:

* Included packages.config in the Octokit projects.
* Made sure OctokitRT includes the ModelExtensions file.
2013-09-24 09:55:07 -07:00
Haacked
997e955f38 Rename to Octokit to be consistent with other API libs
GitHub is naming all of the libraries Octokit for their respective
platforms
2013-01-29 14:00:27 -08:00