Commit graph

53 commits

Author SHA1 Message Date
Milka Kuzminski
5590b13ef5 auth: allow custom name for plugins if defined in the settings. 2020-11-03 13:25:13 +01:00
Marcin Kuzminski
8d9e71fee2 caches: use better name for empty user cache, None was confusing, and looked as if it would be an error. 2020-07-03 11:04:47 +02:00
Marcin Kuzminski
fe96e16646 code: update copyrights to 2020 2020-04-16 00:34:52 +02:00
Marcin Kuzminski
b7e6ccbdc0 ldap: logging fixes 2020-03-19 14:20:23 +01:00
Marcin Kuzminski
8e01135d04 Authentication: cache plugins for auth and their settings in the auth_registry.
- Before that change on each requests 4x we loaded plugins for authentication, this hit
many caches, db invalidation context and loaded the plugins logic each time. This was a heavy performance hit
for SVN and other backends as they needed to load that plugins many many times
- Since Authentication plugins almost never change, we'll not store the plugins listed for authentication into
the authnregistry for each process
- For AuthPlugins settings we now also flush plugins settings, and authnregistry cached plugins
2020-01-23 12:41:51 +01:00
Marcin Kuzminski
928652312a core: added more accurate time measurement for called functions 2019-07-17 16:28:41 +02:00
Marcin Kuzminski
bd1a9c8201 docs: updated copyrights to 2019 2019-01-02 18:13:27 +01:00
Marcin Kuzminski
1ff28bbbfe auth: fixed docstring 2018-11-30 11:48:51 +01:00
Marcin Kuzminski
0fd6e3f6a8 authentication: register global shared session key used for external authentication session data storeage.
- We'll have more plugins not only oauth so this should be a constant name, instead of repating the same name all over the code.
2018-11-26 23:14:55 +01:00
Marcin Kuzminski
c258d66e7b authentication: use registerd UID for plugin definition for more consistent loading of auth plugins. 2018-11-26 23:11:52 +01:00
Marcin Kuzminski
e1bbb01dab ldap: adde common ldap-ce na ldap-ee structure, and extend options
- added timeout
- make the code more shared
- allow specification of tls certdir and certfile manually
2018-11-25 18:47:15 +01:00
Marcin Kuzminski
3947a873c5 auth-plugins: expose docs and icon methods for authentication. 2018-11-21 18:43:26 +01:00
Marcin Kuzminski
b1bfdeb6ba caches: enable cache TTL=30s for auth-plugins.
- mostly due to this gives massive performance gains.
- most of customers choose to use it.
- svn gets *massive* boost from this.
2018-08-11 21:35:19 +02:00
Marcin Kuzminski
f1497f5afd caches: new cache context managers.
- deprecate beaker cache completly
- use new cache decorators from dogpile
- use a proper per cache key invalidation
2018-08-02 18:04:52 +02:00
Marcin Kuzminski
9665179aa5 caches: use new decorator that uses conditional caches skipping dogpile if cache is disabled. 2018-07-14 18:17:42 +02:00
Marcin Kuzminski
cc72ded271 caches: skip cache if user is empty. 2018-07-06 14:47:09 +02:00
Marcin Kuzminski
ddc445856e caches: rewrite of auth/permission caches to dogpile. 2018-07-05 20:14:33 +02:00
Marcin Kuzminski
12d382294e ldap: use connection ping only in case of single server specifed. 2018-05-04 16:13:31 +02:00
Marcin Kuzminski
35d60afec4 auth-plugins: fixed problem with cache of settings in multi-worker mode.
- previous implementation had a bug that cached the settings in each class, caused not refreshing
the update of settings in multi-worker mode. Only restart of rhodecode loaded new settings.
2018-04-10 11:47:00 +02:00
Marcin Kuzminski
ff0e89625a logging: improve auth log chain for easier debugging. 2018-02-28 14:16:15 +01:00
Marcin Lulek
bb9a4574cb auth: fix regression on cache manage namespace generation in case of external plugins a new users. 2018-02-21 10:39:13 +01:00
Marcin Kuzminski
ba5aec079a caches: use individual namespaces per user to prevent beaker caching problems.
- especially for mysql in case large number of data in caches there could be critical errors storing cache, and thus preventing
users from authentication. This is caused by the fact that we used single namespace for ALL users. It means it grew as number of users grew
reaching mysql single column limit.
This changes the behaviour and now we use namespace per-user it means that each user-id will have it's own cache namespace fragmenting maximum column data to
a single user cache. Which we should never reach.
2018-02-15 17:34:09 +01:00
Marcin Kuzminski
90120e6678 authentication: introduce a group sync flag for plugins.
- we'll skip any syncing on plugins which simply don't get any group information
- we let plugins define if they wish to sync groups
- prevent from odd cases in which someone sets user groups as syncing, and using regular
plugin. In this case memebership of that group would be wiped, and it's generaly bad behaviour.
2018-01-24 16:47:06 +01:00
Marcin Kuzminski
00b45c1fa7 release: update copyright year to 2018 2018-01-19 17:13:16 +01:00
Marcin Kuzminski
5f9ae2ae11 pylons: remove pylons as dependency
- dependencies: bumped:
 -setuptools-scm==1.15.6
 -celery==4.1.0
 -kombu==4.1.0
 -pytz==2017.3
 -Routes==2.4.1

Removed all pylons components. Refactored the code to use only pyramid
parts
2017-11-15 13:42:54 +01:00
Marcin Kuzminski
7a512a4788 ldap: fixed regression in extracting settings after library updates.
- somehow we now got '' defaulted to None which changed the behaviour.
2017-11-11 16:43:45 +01:00
Marcin Kuzminski
27697682bc auth: don't cache settings for auth plugins 2017-10-13 10:54:52 +02:00
Marcin Kuzminski
7781eabe94 auth: use cache_ttl from a plugin to also cache permissions.
- this gives a 30% speed increase in operations like svn commit
- generally uses the same mechanismy like auth cache to cache permissions for faster
access to vcs commands
2017-10-07 10:02:39 +02:00
Marcin Kuzminski
78dae50c63 auth: add more login when performing sync of user groups. 2017-09-29 21:36:23 +02:00
Marcin Kuzminski
f445addfdd vcs: reduce sql queries used during pull/push operations. 2017-09-28 21:45:19 +02:00
Marcin Kuzminski
93908a0f84 auth: use our own simpler hybrid property.
- we shouldn't relly on sqlalchemy internal method, it has a different purpose.
2017-07-26 09:54:50 +02:00
Marcin Kuzminski
8417882de5 auth-plugins: add mechanismy to remove secrets from plugin logs.
- it's not recommended to log things like ldap access passwords or
other credentials.
-  we expose a machanismy for each plugin to define a unsafe keys to be
removed.
2017-04-10 17:14:07 +02:00
Marcin Kuzminski
662dda4aa7 auth-plugins: remove dead code 2017-04-10 17:13:09 +02:00
Marcin Kuzminski
8732733a54 authentication: enabled authentication with auth_token and repository scope.
- fixes #3932
- vcs type tokens now with repo scope narrows the usage to a repository.
2017-03-03 20:48:23 +01:00
Marcin Kuzminski
94cd7b2237 authentication: add some more logging when extracting users. 2017-03-03 20:11:35 +01:00
Marcin Kuzminski
8ceda76718 auth: refactor code and simplified instructions.
- added new rfc selector
- cleanup imports
2017-02-21 18:05:29 +01:00
Marcin Kuzminski
fcc027c282 license: updated copyright year to 2017 2017-01-02 09:30:39 +01:00
Martin Bornhold
72819c6826 auth: Allow auth plugins to customize the slug which is used to generate URLs. #4078 2016-10-28 14:03:27 +02:00
Martin Bornhold
c46ad9f215 vcs: Pass registry to vcs for user authentication.
Explicit pass the registry insted of indirectly using it via pyramids
thread locals.
2016-08-08 08:29:10 +02:00
Martin Bornhold
bee42a50ed auth: Fix renaming of 'auth_cahe_ttl' to 'cache_ttl' #4127 2016-07-27 15:54:42 +02:00
Marcin Kuzminski
af6f54dbae auth-plugins: added better log message about the auth-cache-ttl settings. 2016-07-26 13:09:31 +02:00
Marcin Kuzminski
ab6750c9a7 auth-token: allow other authentication types to use auth-token.
Fixes #4070
2016-07-12 19:56:48 +02:00
Johannes Bornhold
cf906eafe6 authn: Use type() instead of __class__ attribute. 2016-06-21 08:09:55 +02:00
Johannes Bornhold
a1b5f9d602 authn: Allow to pass in a default value if setting is not available in DB. 2016-06-20 17:25:35 +02:00
Johannes Bornhold
825e26db6f authn: Don't use setting value to compute the setting type. 2016-06-20 11:52:24 +02:00
Johannes Bornhold
4e9923b5ae auth: Implement __str__ on plugin base class
This way some error messages will look nicer, since they are based on the
__str__ of the plugin instance. Using the plugin_id will give the user (and us
in the support case) the exact pointer to the affected plugins.
2016-06-16 09:11:45 +02:00
Johannes Bornhold
d05c4fb045 authn: Use new is_headers_auth function. 2016-06-06 10:15:00 +02:00
Johannes Bornhold
50474589c2 authn: Deprecate the is_container_auth function. 2016-06-06 10:22:42 +02:00
Johannes Bornhold
a29b8b84a5 authn: Rename 'container' -> 'headers' in authentication. 2016-06-06 10:33:01 +02:00
Johannes Bornhold
a44e92e154 authn: Fix form validation of authentication plugins.
- Check if plugin exists.
- Display an apropriate error message if it doesn't exist.
2016-06-03 11:22:13 +02:00