Commit Graph

27 Commits

Author SHA1 Message Date
linoman
51da96d94e
Auth: Add IsClientEnabled and IsEnabled for the authn.Service and authn.Client interfaces (#86034)
* Add `Service. IsClientEnabled` and `Client.IsEnabled` functions

* Implement `IsEnabled` function for authn clients

* Implement `IsClientEnabled` function for authn services
2024-04-15 10:54:50 +02:00
Misi
8796d2d307
Auth: Convert SetDefaultOrgHook to PostLoginHook (#85649)
* Convert SetDefaultOrgHook to PostLoginHook
2024-04-05 16:03:51 +02:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
Alexander Zobnin
b4d363e8fe
Chore: Fix broken anonymous devices test (#81649) 2024-01-31 17:09:32 +02:00
Eric Leijonmarck
b43b2608b5
Chore: Enable and Fix flaky test in anonimpl service (#80896)
* fix: flaky test

* set fixed time instead

* flaky
2024-01-23 12:27:26 +00:00
Marcus Efraimsson
6768c6c059
Chore: Remove public vars in setting package (#81018)
Removes the public variable setting.SecretKey plus some other ones. 
Introduces some new functions for creating setting.Cfg.
2024-01-23 12:36:22 +01:00
Eric Leijonmarck
81a49e8016
Anon: Fix comment out flaky test in anonimpl (#80728)
* fix: flaky test

* add one line
2024-01-17 15:19:29 +00:00
Misi
da6926f6f7
Auth: SSOSettings handle secret update (#80591)
* first touches

* Merge missing SSO settings to support Advanced Auth pages

* fix

* Update secrets correctly

* Add test for upsert with redactedsecret

* Verify decryption in the List tests
2024-01-17 15:55:55 +02:00
Eric Leijonmarck
28009228e5
Anonymous: Fix flaky tests (#80631)
fix: flaky tests
2024-01-16 15:41:28 +00:00
Eric Leijonmarck
3979ea0c47
Anonymous Access: Pagination for devices (#80028)
* first commit

* add: pagination to anondevices

* fmt

* swagger and tests

* swagger

* testing out test

* fixing tests

* made it possible to query for from and to time

* refactor: change to query for ip adress instead

* fix: tests
2024-01-15 12:13:38 +00:00
Jo
ffbf1b1413
Anon: Small fixes to anon service structure (#79566)
* add ListDevices to service

* improve fake

* fix missing cfg field

* cannot be unexported
2023-12-15 15:15:04 +01:00
Jo
3647ba7360
Anonymous: Add configurable device limit (#79265)
* Anonymous: Add device limiter

* break auth if limit reached

* fix typo

* refactored const to make it clearer with expiration

* anon device limit for config

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2023-12-12 12:57:25 +02:00
Eric Leijonmarck
59bdff0280
Auth: Add anonymous users view and stats (#78685)
* Add anonymous stats and user table

- anonymous users users page
- add feature toggle `anonymousAccess`
- remove check for enterprise for `Device-Id` header in request
- add anonusers/device count to stats

* promise all, review comments

* make use of promise all settled

* refactoring: devices instead of users

* review comments, moved countdevices to httpserver

* fakeAnonService for tests and generate openapi spec

* do not commit openapi3 and api-merged

* add openapi

* Apply suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* formatin

* precise anon devices to avoid confusion

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: jguer <me@jguer.space>
2023-11-29 17:58:41 +01:00
Jo
69b2442a0d
Anon: Use xorm for anon service (#75964)
use xorm for anon service
2023-10-04 17:19:56 +02:00
Karl Persson
7a38090bc0
AuthN: Fix namespaces for anonymous and render (#75661)
* AuthN: remove IsAnonymous from identity struct and set correct namespace for anonymous and render

* Don't parse user id for render namespace
2023-09-29 09:10:33 +02:00
Karl Persson
fd2235b5ad
AuthN: Implement requester interface for identity (#75618)
* AuthN: Implement identity.Requester interface for authn.Identity

* AuthN: Replace OrgRole with GetOrgRole

* IDForwarding: skip converting to SignedInUser

* Pass identity directly in permission sync hook
2023-09-28 16:37:32 +02:00
Jo
40a1f8434d
Anon: Scaffold anon service (#74744)
* remove API tagging method and authed tagging

* add anonstore

move debug to after cache

change test order

fix issue where mysql trims to second

* add old device cleanup

lint

utc-ize everything

trim whitespace

* remove dangling setting

* Add delete devices

* Move anonymous authnclient to anonimpl

* Add simple post login hook

* move registration of Background Service

cleanup

* add updated_at index

* do not untag device if login err

* add delete device integration test
2023-09-25 16:25:29 +02:00
Serge Zaitsev
8187d8cb66
Chore: capitalise log message for auth packages (#74332) 2023-09-04 18:49:47 +02:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Jo
1a281ac49d
Experiment: tag UI devices for anon stats (#73748)
* experiment: attempt to tag only UI devices

* lint frontend

* use await

* use shorthand check

* do not assume build info exists

* do not assume build info exists

* Apply suggestions from code review

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2023-08-28 10:49:23 +02:00
Jo
3353b1a8aa
Auth: Add authed device tagging (#72442)
* add authed device tagging

* fix config

* implement feedback

* implement feedback

* add reverse untag behavior

* remove duplicate stat

* Update pkg/services/anonymous/anonimpl/impl.go
2023-07-31 18:04:28 +02:00
Jo
a4a87f6228
Auth: Rename Sessions to Devices in counting (#72432)
* rename session to device

* rename session to device
2023-07-27 11:09:08 +02:00
Jo
aade4b0bd2
AnonymousService: Test tagging service (#64708)
* add anonymous tagging tests

* lint
2023-03-14 10:47:34 +01:00
Carl Bergquist
eb507dca89
Remotecache: rename setbytearray/getbytearray to set/get and remove codec (#64470)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-03-10 13:57:29 +01:00
Carl Bergquist
7c55dbf37d
Remotecache: Migrates get/set calls to use bytearrays and remove get/set functions (#63525)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-03-08 17:08:57 +01:00
Jo
1e84d5d93c
Authn: Add caching for anon service (#63521)
add local cache to protect multiple writes to DB cache
2023-02-22 09:59:28 +01:00
Jo
ff78103a24
Authn: Anon session service (#63052)
* add anon sessions package

* add usage stat fn

* implement count for cache

* add anonservice to authn broker

* lint

* add tests for remote cache count

* move anon service to services

* wrap tagging in goroutine

* make func used
2023-02-21 16:21:18 +01:00