Commit Graph

901 Commits

Author SHA1 Message Date
Łukasz Domeradzki
6b0bf0f9c1 Closes #3061 (#3145)
* Good start

* Misc

* Make ApiAuthenticationMiddleware use new json

* Remove first newtonsoft dependency

* Pull latest ASFB json enhancements

* Start reimplementing newtonsoft!

* One thing at a time

* Keep doing all kind of breaking changes which need to be tested later

* Add back ShouldSerialize() support

* Misc

* Eradicate remaining parts of newtonsoft

* WIP

* Workaround STJ stupidity in regards to derived types

STJ can't serialize derived type properties by default, so we'll use another approach in our serializable file function

* Make CI happy

* Bunch of further fixes

* Fix AddFreeLicense() after rewrite

* Add full support for JsonDisallowNullAttribute

* Optimize our json utilities even further

* Misc

* Add support for fields in disallow null

* Misc optimization

* Fix deserialization of GlobalCache in STD

* Fix non-public [JsonExtensionData]

* Fix IM missing method exception, correct db storage helpers

* Fix saving into generic databases

Thanks STJ

* Make Save() function abstract to force inheritors to implement it properly

* Correct ShouldSerializeAdditionalProperties to be a method

* Misc cleanup

* Code review

* Allow JSON comments in configs, among other

* Allow trailing commas in configs

Users very often add them accidentally, no reason to throw on them

* Fix confirmation ID

Probably needs further fixes, will need to check later

* Correct confirmations deserialization

* Use JsonNumberHandling

* Misc

* Misc

* [JsonDisallowNull] corrections

* Forbid [JsonDisallowNull] on non-nullable structs

* Not really but okay

* Add and use ToJson() helpers

* Misc

* Misc
2024-02-21 03:09:36 +01:00
Archi
716b253a04 Move from System.IdentityModel.Tokens.Jwt to Microsoft.IdentityModel.JsonWebTokens
> As of IdentityModel 7x, this is a legacy tool that should be replaced with Microsoft.IdentityModel.JsonWebTokens.

> This is a newer, faster version of System.IdentityModel.Tokens.Jwt that has additional functionality
2024-01-30 13:26:32 +01:00
Archi
bccdf269f0 Closes #3115 2023-12-29 13:23:38 +01:00
Archi
f2ff2f4929 Closes #3060 2023-11-14 20:01:29 +01:00
Łukasz Domeradzki
d571cd9580 Closes #3043 (#3044)
* Implement support for access tokens

A bit more work and testing is needed

* Make ValidUntil computed, fix netf, among others

* netf fixes as always

* Allow AWH to forcefully refresh session

* Unify access token lifetime
2023-10-19 13:38:39 +02:00
Archi
dbbfc7344b Closes #2850 2023-03-24 13:51:17 +01:00
Łukasz Domeradzki
dd663f43b9 Closes #2840 (#2843)
* Initial login flow changes

* I hate windows

* Make it compile

* Hehe, you bet

* Another approach

* Misc

* Misc

* Final touches

* Misc

* Okay xpaw

* xPaw update

* Keep set input for reconnection

* Unify login errors

* Add missing registry entry

* Final touches before I lose my sanity
2023-03-17 23:59:46 +01:00
Archi
8008a04354 Code cleanups and improvements
- Make use of new UnixFileMode, always one native method we need to maintain less
- Add madness support for it, because new feature of course
- Add optional netstandard target and required compatibility for it, so I can test netf-oriented changes easier
2023-02-09 02:25:11 +01:00
JustArchi
32cdb45e9f Misc 2022-10-09 18:51:34 +02:00
JustArchi
cc55e386c9 Upgrade generic-netf to .NET Framework 4.8.1 2022-09-07 23:25:45 +02:00
Sebastian Göls
41ecfb1d02 Move copying of overlay files to ArchiSteamFarm.csproj (#2650)
* Move copying of overlay files to ArchiSteamFarm.csproj

* Fix build on Windows

* Try to make it more reliable

* Update ArchiSteamFarm.csproj

* Update ArchiSteamFarm.csproj

* Revert "Update ArchiSteamFarm.csproj"

This reverts commit ba41b2e3c1.

* Rename

Co-authored-by: JustArchi <JustArchi@JustArchi.net>
2022-07-19 22:20:18 +02:00
Łukasz Domeradzki
7118185ac5 Remove support for IPC localization (#2545) 2022-03-24 01:47:12 +01:00
lrcf
d06afa26d4 LICENSE-2.0.txt > LICENSE.txt (#2539) 2022-03-16 16:41:08 +01:00
Archi
0964cdac96 Minimize define hell
Skipping a 20 KB stub in OS-specific non-windows builds and omitting a few very fast if checks isn't worth the code quality degradation that involves all of the ifdef options.

ifdefs should be reserved for stuff that either doesn't compile whatsoever in some specific configurations (NETFRAMEWORK), or is required to make logical decisions based on the compiler input (e.g. DEBUG for detecting debugging builds or ASF_VARIANT_* for hardcoding the platform identifier to use for auto-updates)

In all other situations, we should use OperatingSystem if condition, even if it's equal to hitting them on the platforms that are unlikely to hit them.

And I say unlikely, because nothing stops me from downloading a win-x64 build and running it like a generic one on windows, what you gonna do?
2021-11-10 19:03:05 +01:00
Sebastian Göls
fb4eb0b03a Use Madness via global usings (#2447)
* Use Madness via global usings

* Apply feedback

* Disable false positive null warning
2021-11-09 16:33:09 +01:00
Archi
35ca44ee01 Remove System.IO.FileSystem.AccessControl dependency
It's included in .NET 6.0 now
2021-11-08 23:45:19 +01:00
Sebastian Göls
d894f3a830 Localize IPC (#2431)
* Localize IPC

* Keep logs in one language

* Cleanup

* Revert changes that keep strings in one locale

* Order dependencies alphabetically

* Fix formatting (Thanks, Rider -.-)
2021-10-25 20:24:56 +02:00
Sebastian Göls
be027523ac Warn about insecure passwords (#2419)
* Add warnings about password security

* Warn about weak steam passwords even if they are encrypted

* Apply feedback

* Apply feedback

* Simplify code

* Move return criteria up a bit for increased performance

* Choose more fitting strings for localization

* Extract const value

* Fix incorrect null reference warning

* Switch prefix operator for postfix one

Co-authored-by: Łukasz Domeradzki <JustArchi@JustArchi.net>

* Add tests

* Disable CA1724

The type name Utilities conflicts in whole or in part with the namespace name 'Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities'.

* Tell users why their password is considered weak

* Apply feedback

* Merge resource comments

* Misc.

* Use library for password testing and Run testing in background

* Clean up

* OncSeparate forbidden phrases forfor IPC passwords (once again)

* Additionally check encryption key

* Add comment about {0}

Co-authored-by: Łukasz Domeradzki <JustArchi@JustArchi.net>
2021-10-13 21:44:48 +02:00
Archi
4935ec3187 Remove support for SystemEvents.TimeChanged
This causes excessive delay during ASF shutdown on Windows, and because it's completely optional for irrelevant feature, it's not worth the burden
2021-09-02 13:45:56 +02:00
Archi
b32548d366 Remove explicit NLog dependency
NLog is included as part of NLog.Web.AspNetCore, we do not require a direct dependency.
2021-08-30 01:08:23 +02:00
Vitaliya
06b11a3129 Disable unsafe for netf (#2405) 2021-08-19 17:50:18 +02:00
Łukasz Domeradzki
bb513921f1 Include ASF's windows-only parts only in generic and windows builds (#2404)
* Include ASF's windows-only parts only in generic and windows builds

* Apply Abry's note
2021-08-13 23:07:17 +02:00
Łukasz Domeradzki
f403e9c296 Better April Fools (#2401)
* Better April Fools

* Guard timer with lock

It's not thread-safe

* Address Abry note

* Add extra 100ms to the timer calculation
2021-08-10 11:43:36 +02:00
Archi
46b2376849 Mark JetBrains.Annotations as private asset
Madness research shows that this doesn't need dll inclusion
2021-08-08 12:51:38 +02:00
Archi
911680d606 Remove IndexRange from explicit dependencies
Madness implicitly includes it already
2021-08-07 14:08:06 +02:00
Łukasz Domeradzki
9f281c6055 Embrace madness (#2394)
* Embrace madness

* Remove unused code

* Misc

* Address Abry's note

* Update for Madness 0.3.0
2021-08-07 14:03:46 +02:00
Archi
37689f4de6 Misc XML cleanup 2021-07-15 23:06:16 +02:00
Archi
d479eb9f97 Address Rider EAP inspections/cleanup 2021-07-12 21:45:17 +02:00
Archi
5d9bb8f2bb Include ASF's license in output of the build 2021-07-11 01:56:44 +02:00
Archi
28242aa6e8 IPC: Implement ResponseCaching
This actually does two things: client caching and server caching

Client caching considers only static files, for which we instruct the web browser to revalidate each cache usage with our server to ensure that it's up-to-date.

Server caching with those settings actually doesn't work (nothing to do), but may in the future as lack of no-store means that server is technically allowed to cache I/O read files for as long as it can guarantee they didn't change on the disk.
2021-07-04 21:36:54 +02:00
JustArchi
48922300d0 Implement security hardening for IsValidBotName()
And add missing support on netf for it...
2021-05-07 20:22:23 +02:00
Łukasz Domeradzki
0808a38f48 Manage package versions centrally (#2317)
Closes #2316

The issue we're facing right now comes from the fact of desynchronization of packages between different projects. Since I didn't find any way to "fix" the package versions of our plugins to the main ASF project, we'll instead use centralized Directory.packages.props which specifies appropriate versions
2021-05-02 14:51:08 +02:00
dependabot-preview[bot]
24ca82c526 Bump Swashbuckle.AspNetCore.Newtonsoft from 6.1.3 to 6.1.4
Bumps [Swashbuckle.AspNetCore.Newtonsoft](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.3 to 6.1.4.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.3...v6.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-30 13:18:11 +00:00
dependabot-preview[bot]
a400ebccee Bump Swashbuckle.AspNetCore from 6.1.3 to 6.1.4
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.3 to 6.1.4.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.3...v6.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-30 12:27:22 +00:00
dependabot-preview[bot]
c7dbaa0828 Bump Swashbuckle.AspNetCore.Annotations from 6.1.3 to 6.1.4
Bumps [Swashbuckle.AspNetCore.Annotations](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.3 to 6.1.4.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.3...v6.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-30 11:22:29 +00:00
dependabot-preview[bot]
e7a19e0e9f Bump Humanizer from 2.8.26 to 2.9.9
Bumps [Humanizer](https://github.com/Humanizr/Humanizer) from 2.8.26 to 2.9.9.
- [Release notes](https://github.com/Humanizr/Humanizer/releases)
- [Changelog](https://github.com/Humanizr/Humanizer/blob/main/release_notes.md)
- [Commits](https://github.com/Humanizr/Humanizer/compare/v2.8.26...v2.9.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-28 09:39:18 +00:00
JustArchi
857e9a140f Initialize localization strings for STD plugin 2021-04-25 19:55:30 +02:00
dependabot-preview[bot]
33bb981778 Bump Swashbuckle.AspNetCore.Newtonsoft from 6.1.2 to 6.1.3
Bumps [Swashbuckle.AspNetCore.Newtonsoft](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.2 to 6.1.3.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.2...v6.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-20 12:59:10 +00:00
dependabot-preview[bot]
1b8da1971f Bump Swashbuckle.AspNetCore.Annotations from 6.1.2 to 6.1.3
Bumps [Swashbuckle.AspNetCore.Annotations](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.2 to 6.1.3.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.2...v6.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-20 12:10:18 +00:00
dependabot-preview[bot]
a32e5e4f04 Bump Swashbuckle.AspNetCore from 6.1.2 to 6.1.3
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.2 to 6.1.3.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.2...v6.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-20 11:06:13 +00:00
dependabot-preview[bot]
4b80fbaf7a Bump Swashbuckle.AspNetCore.Newtonsoft from 6.1.1 to 6.1.2
Bumps [Swashbuckle.AspNetCore.Newtonsoft](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.1...v6.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-09 19:08:20 +00:00
dependabot-preview[bot]
92e1a55583 Bump Swashbuckle.AspNetCore.Annotations from 6.1.1 to 6.1.2
Bumps [Swashbuckle.AspNetCore.Annotations](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.1...v6.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-09 18:18:34 +00:00
dependabot-preview[bot]
4a8c97353d Bump Swashbuckle.AspNetCore from 6.1.1 to 6.1.2
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.1...v6.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-09 17:11:41 +00:00
dependabot-preview[bot]
b6445aed86 Bump JetBrains.Annotations from 2020.3.0 to 2021.1.0
Bumps JetBrains.Annotations from 2020.3.0 to 2021.1.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-06 09:00:18 +00:00
dependabot-preview[bot]
ae4f97f5c1 Bump NLog.Web.AspNetCore from 4.11.0 to 4.12.0
Bumps [NLog.Web.AspNetCore](https://github.com/NLog/NLog.Web) from 4.11.0 to 4.12.0.
- [Release notes](https://github.com/NLog/NLog.Web/releases)
- [Changelog](https://github.com/NLog/NLog.Web/blob/master/CHANGELOG.MD)
- [Commits](https://github.com/NLog/NLog.Web/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-29 20:31:40 +00:00
dependabot-preview[bot]
335f65546c Bump NLog from 4.7.8 to 4.7.9
Bumps [NLog](https://github.com/NLog/NLog) from 4.7.8 to 4.7.9.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/v4.7.9/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v4.7.8...v4.7.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-24 22:50:52 +00:00
dependabot-preview[bot]
f305561f47 Bump Newtonsoft.Json from 12.0.3 to 13.0.1
Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/12.0.3...13.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-22 22:25:09 +00:00
dependabot-preview[bot]
2c14846c2f Bump Markdig.Signed from 0.23.0 to 0.24.0
Bumps [Markdig.Signed](https://github.com/xoofx/markdig) from 0.23.0 to 0.24.0.
- [Release notes](https://github.com/xoofx/markdig/releases)
- [Changelog](https://github.com/xoofx/markdig/blob/master/changelog.md)
- [Commits](https://github.com/xoofx/markdig/compare/0.23.0...0.24.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-20 14:10:48 +00:00
dependabot-preview[bot]
a7c38bb844 Bump Swashbuckle.AspNetCore from 6.1.0 to 6.1.1
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.0...v6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-16 23:02:00 +00:00
dependabot-preview[bot]
50e792f8a7 Bump Swashbuckle.AspNetCore.Newtonsoft from 6.1.0 to 6.1.1
Bumps [Swashbuckle.AspNetCore.Newtonsoft](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v6.1.0...v6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-16 20:08:20 +00:00