1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-24 12:48:48 -05:00

47 Commits

Author SHA1 Message Date
Henrik
8bac7f0145
[PM-14476] Avoid multiple lookups in dictionaries (#4973)
* Avoid multiple lookups in dictionaries

* Consistency in fallback to empty CollectionIds

* Readability at the cost of lines changed

* Readability

* Changes after running dotnet format
2025-06-02 11:18:28 -05:00
Matt Gibson
4377c7a897
Rewrite Icon fetching (#3023)
* Rewrite Icon fetching

* Move validation to IconUri, Uri, or UriBuilder

* `dotnet format` 🤖

* PR suggestions

* Add not null compiler hint

* Add twitter to test case

* Move Uri manipulation to UriService

* Implement MockedHttpClient

Presents better, fluent handling of message matching and response
building.

* Add redirect handling tests

* Add testing to models

* More aggressively dispose content in icon link

* Format 🤖

* Update icon lockfile

* Convert to cloned stream for HttpResponseBuilder

Content was being disposed when HttResponseMessage was being disposed.
This avoids losing our reference to our content and allows multiple
usages of the same `MockedHttpMessageResponse`

* Move services to extension

Extension is shared by testing and allows access to services from
our service tests

* Remove unused `using`

* Prefer awaiting asyncs for better exception handling

* `dotnet format` 🤖

* Await async

* Update tests to use test TLD and ip ranges

* Remove unused interfaces

* Make assignments static when possible

* Prefer invariant comparer to downcasing

* Prefer injecting interface services to implementations

* Prefer comparer set in HashSet initialization

* Allow SVG icons

* Filter out icons with unknown formats

* Seek to beginning of MemoryStream after writing it

* More appropriate to not return icon if it's invalid

* Add svg icon test
2023-08-08 19:29:40 +00:00
Justin Baur
7f5f010e1e
Run formatting (#2230) 2022-08-29 16:06:55 -04:00
Justin Baur
bae03feffe
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)"

This reverts commit 239286737d15cb84a893703ee5a8b33a2d67ad3d.

* Revert "Turn on file scoped namespaces (#2225)"

This reverts commit 34fb4cca2aa78deb84d4cbc359992a7c6bba7ea5.
2022-08-29 15:53:48 -04:00
Justin Baur
34fb4cca2a
Turn on file scoped namespaces (#2225) 2022-08-29 14:53:16 -04:00
Justin Baur
231eb84e69
Turn On ImplicitUsings (#2079)
* Turn on ImplicitUsings

* Fix formatting

* Run linter
2022-06-29 19:46:41 -04:00
Oscar Hinton
23b0a1f9df
Run dotnet format (#1764) 2021-12-16 15:35:09 +01:00
Kyle Spearrin
f26a235964
set MaxResponseContentBufferSize to 5 MB (#1702) 2021-11-09 11:32:23 -05:00
Kyle Spearrin
9582e94232
add ::ffff: to internal ip check (#1701)
* add ::ffff: to internal ip check

* check StartsWith
2021-11-09 11:16:54 -05:00
Kyle Spearrin
cf303f2f97
catch errors when trying to resolve DNS (#841) 2020-07-28 23:22:02 -04:00
Kyle Spearrin
036b402e9f
update ip IsInternal() to account for missed ranges (#827)
* update ip IsInternal() to account for missed ranges

* update with `::`
2020-07-18 08:08:57 -04:00
Kyle Spearrin
8a46fcd301
Resolve host to check for private IP address (#812) 2020-07-07 19:47:12 -04:00
Kyle Spearrin
9cb103e6aa update comment 2020-05-01 11:09:44 -04:00
Kyle Spearrin
7abfefd167 replace ip regex with IPAddress.Parse 2020-05-01 11:08:47 -04:00
Kyle Spearrin
3462613f49 Do not request local hosts or ip addresses 2020-04-30 11:41:30 -04:00
Kyle Spearrin
68901437ba only fetch icons from http(s) with default ports 2020-04-30 11:23:40 -04:00
Chad Scharf
9800b752c0 Changed all C# control flow block statements to include space between keyword and open paren 2020-03-27 14:36:37 -04:00
Kyle Spearrin
48ec345702 update stripe SDK 2019-08-08 17:36:41 -04:00
Kyle Spearrin
2f300107ce Remove error log on send 2019-07-11 21:12:20 -04:00
Kyle Spearrin
bc2621f45f log httpclient send exceptions 2019-07-05 14:20:16 -04:00
Kyle Spearrin
35e986a077 update libs and remove old code/workarounds 2019-02-26 08:15:56 -05:00
Kyle Spearrin
594c9e9e3e blacklist of link rels to ignore 2019-02-16 09:15:24 -05:00
Kyle Spearrin
5cfb43bebf webp support 2018-10-05 09:13:57 -04:00
Kyle Spearrin
7fd79388e2 dont try to fetch ip address icons 2018-08-25 17:30:45 -04:00
Kyle Spearrin
6f7d07530a log domain with warnings 2018-08-25 16:59:54 -04:00
Kyle Spearrin
e7dbe6d4be null check response 2018-08-25 16:52:49 -04:00
Kyle Spearrin
0956374a06 icon server logging 2018-08-25 16:41:26 -04:00
Kyle Spearrin
a564df42d6 try base domain if others fail 2018-08-10 11:21:52 -04:00
Kyle Spearrin
90df2f21e5 TryCreate on each uri 2018-07-02 10:50:48 -04:00
Kyle Spearrin
37375d8653 use parsedUri.Host 2018-06-28 10:18:35 -04:00
Kyle Spearrin
4dfef9fa96 TryCreate uri first 2018-06-28 10:15:54 -04:00
Kyle Spearrin
3bf468c545 take fixes 2018-06-25 09:59:32 -04:00
Kyle Spearrin
9561b167f7 icon service fixes 2018-06-25 09:28:54 -04:00
Kyle Spearrin
5c13802879 GetScheme helper 2018-06-19 17:28:45 -04:00
Kyle Spearrin
06db27ae19 cleanup recursion and location header 2018-06-19 17:21:31 -04:00
Kyle Spearrin
e1df06ec33 cleanup memory refs. switch to anglesharp lib 2018-06-19 15:14:12 -04:00
Kyle Spearrin
145e4c69d4 cleanup html node refs 2018-06-19 10:18:11 -04:00
Kyle Spearrin
a6260c867c only take up to 40 links 2018-05-31 22:04:01 -04:00
Kyle Spearrin
68125d2c9b try to find format of any non-allowed type 2018-05-25 14:19:40 -04:00
Kyle Spearrin
6d3ad7d9e4 optimize 2018-05-25 14:12:18 -04:00
Kyle Spearrin
1cfc95df7c icon fetch fixes 2018-05-25 12:50:21 -04:00
Kyle Spearrin
0e4ffc7d7f new icon fetching service. remove besticon dep. 2018-05-22 12:49:34 -04:00
Kyle Spearrin
294a80436e fix walgreens photo mapping 2017-10-21 23:16:06 -04:00
Kyle Spearrin
184c5f7f96 map yandex 2017-10-21 22:06:21 -04:00
Kyle Spearrin
b102152133 map wallgreens 2017-10-21 00:20:16 -04:00
Kyle Spearrin
30f5861647 map yahoo login 2017-10-20 23:33:52 -04:00
Kyle Spearrin
4d7bd85490 domain mapping service and more cleanup 2017-10-09 14:21:20 -04:00