grafana/pkg/server
Michael Mandrus f9d86557cf
Dashboard: Mix initials and custom gravatars in recent viewers list (#47212)
* Use Wiring to initialize Avatar Cache Server

Create AvatarCacheServer Provider function and pass it in as an
argument to HTTPServer. Also convert CacheServer to a singleton
so that we keep all cached Avatar info in one place for easier access

* Refactor avatar cache server and add 'isCustom' check

Avatar cache server needs to perform two similar fetches
back-to-back; break up functions to allow for easy reuse.
Then add handling to see if a user has a custom avatar.

* Add additional accessors so that /recents api can easily use the cache

* Minor mods to avatar server to facilitiate unit testing

* add unit tests for avatar fetching

* add error handling in case we somehow fetch gravatars while they are disabled

* linting: read error return value in unit test

* Use http package status codes

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>

* Use http package status codes

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>

* Use http package status codes

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>

* Incorporate suggestions from PR
-avoid mutating arguments
-change error handler function to private and make name more descriptive

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>
2022-04-05 22:56:17 -04:00
..
backgroundsvcs Storage: add basic storage service (#46604) 2022-03-17 10:19:23 -07:00
server_test.go Migrate to Wire for dependency injection (#32289) 2021-08-25 15:11:22 +02:00
server.go Chore: Remove bus.Dispatch from some login packages (#47248) 2022-04-04 20:36:15 +02:00
test_env.go Chore: Remove bus from ngalert (#44465) 2022-01-26 16:42:40 +01:00
wire.go Dashboard: Mix initials and custom gravatars in recent viewers list (#47212) 2022-04-05 22:56:17 -04:00
wireexts_oss.go Access control: Use access control for dashboard and folder (#44702) 2022-03-03 15:05:47 +01:00