| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Defines main bulk of public API of auth component. | 5 """Defines main bulk of public API of auth component. |
| 6 | 6 |
| 7 Functions defined here can be safely called often (multiple times per request), | 7 Functions defined here can be safely called often (multiple times per request), |
| 8 since they are using in-memory read only cache of Auth DB entities. | 8 since they are using in-memory read only cache of Auth DB entities. |
| 9 | 9 |
| 10 Functions that operate on most current state of DB are in model.py. And they are | 10 Functions that operate on most current state of DB are in model.py. And they are |
| 11 generally should not be used outside of Auth components implementation. | 11 generally should not be used outside of Auth components implementation. |
| 12 """ | 12 """ |
| 13 | 13 |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 # Propagate reference to original function, mark function as decorated. | 963 # Propagate reference to original function, mark function as decorated. |
| 964 wrapper.__wrapped__ = original | 964 wrapper.__wrapped__ = original |
| 965 wrapper.__auth_require = True | 965 wrapper.__auth_require = True |
| 966 | 966 |
| 967 return wrapper | 967 return wrapper |
| 968 | 968 |
| 969 | 969 |
| 970 def is_decorated(func): | 970 def is_decorated(func): |
| 971 """Return True if |func| is decorated by @public or @require decorators.""" | 971 """Return True if |func| is decorated by @public or @require decorators.""" |
| 972 return hasattr(func, '__auth_public') or hasattr(func, '__auth_require') | 972 return hasattr(func, '__auth_public') or hasattr(func, '__auth_require') |
| OLD | NEW |