Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch audit-uname Excluding Merge-Ins
This is equivalent to a diff from 75bacf6ac9 to f0726c4306
|
2022-02-04
| ||
| 17:49 | Merged the audit-uname branch - audit username read from a custom variable instead of a temporary table. check-in: baf3590749 user: ppdb tags: trunk | |
| 11:47 | Added test to check that the logged in username is set in an UPDATE audit record. Closed-Leaf check-in: f0726c4306 user: ppdb tags: audit-uname | |
| 08:38 | Use a custom variable to pass the logged in username to the audit procedure instaed of a temporary table. check-in: ea1c578197 user: ppdb tags: audit-uname | |
| 08:28 | Create new branch named "audit-uname" check-in: 1ea7e3fbb4 user: ppdb tags: audit-uname | |
| 08:26 | Update messages for the 2022-01-31 tables check-in: 75bacf6ac9 user: ppdb tags: trunk | |
|
2022-02-03
| ||
| 14:55 | Updated data conversion for the 20220131 tables. check-in: 6b2f530baf user: ppdb tags: trunk | |
Changes to ppdb/const.py.
| ︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | """ The absolute path to the package. Initialised at app startup by ppd.py """ JINJA_ENV = None """ The Jinja2 templating environment. Initialised at app startup by ppd.py """ VERSION = '0.93.0' VERSION__doc = """ The PPDB code version """ |
| ︙ |
Changes to ppdb/lib/pglib.py.
| ︙ | |||
203 204 205 206 207 208 209 | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - - + |
cherrypy.thread_data.dbconn.close()
cherrypy.thread_data.dbconn = None
db_connect()
curs = cherrypy.thread_data.dbconn.cursor()
else:
raise DBAPIError(inspect.stack()[0][3], "Connection retry failed")
curs.execute("SET search_path TO %s,public;" % schema)
|
| ︙ |
Changes to ppdb/lib/sheep_schema.py.
| ︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + |
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
# Disable constant name case warnings
# pylint: disable=C0103
# The schema version
|
| ︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + |
if { [info exists NEW(change_reason)] } {
set reason $NEW(change_reason)
} else {
set reason "New Record"
}
spi_exec "INSERT INTO audit_history VALUES (DEFAULT, '$TG_op',
|
| ︙ | |||
165 166 167 168 169 170 171 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | - + |
set old_data [join $pairs ","]
if {$2 ne ""} {
set row_select_1 $OLD($2)
} else {
set row_select_1 ""
}
spi_exec "INSERT INTO audit_history VALUES (DEFAULT, '$TG_op',
|
| ︙ |
Changes to ppdb/lib/tools.py.
| ︙ | |||
179 180 181 182 183 184 185 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - - + |
method_roles = userlib.get_url_roles(url_roles, cherrypy.request.method)
for role in login_roles:
if role in method_roles:
cherrypy.request.loginroles = login_roles
with pglib.get_conn():
with pglib.cursor() as curs:
|
| ︙ |
Changes to ppdb/test/__init__.py.
| ︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | - - - - + |
if refresh:
refresh_test_database(dbname)
pglib.initialise(dbconf, False)
pglib.make_db_connection(dbparm)
with pglib.get_conn():
with pglib.cursor() as curs:
|
| ︙ | |||
244 245 246 247 248 249 250 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - - - - - - - |
""" Return lists of the available areas sorted the way Javascript does"""
return make_request(cls.host, 'GET', "/test/rptdata/jsareas", 200)['data']
def set_cp_domainbase(domainbase):
""" Set domainbase to CherryPy's config """
cherrypy.config['domainbase'] = domainbase
|
| ︙ |
Changes to ppdb/test/appinit_test.py.
| ︙ | |||
64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | + |
else:
# This is required to run tests on HTTP
self.uri_tree._cp_config['tools.sessions.secure'] = False
# Add new test branch. These uris are used to get test data and delete test
# resources
self.uri_tree.test = testuri.Test(self.appconf)
self.uri_tree.test.audit = testuri.Audit(self.appconf)
self.uri_tree.test.sheep = testuri.Sheep(self.appconf)
self.uri_tree.test.transfer = testuri.Transfer(self.appconf)
self.uri_tree.test.member = testuri.Member(self.appconf)
self.uri_tree.test.person = testuri.Person(self.appconf)
self.uri_tree.test.meminfo = testuri.MemInfo(self.appconf)
self.uri_tree.test.role = testuri.Role(self.appconf)
self.uri_tree.test.rptdata = testuri.ReportData(self.appconf)
|
| ︙ |
Changes to ppdb/test/selweb/test_logon.py.
| ︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + |
""" CC - Click Logout. Check the user is logged out and the root page is displayed """
self.click("sidenav-open-btn")
elem = self.wait_for_link_text("Logout User 'admin'")
elem.click()
self.wait_for_element_by_id("title")
self.assert_equal(self.get_text("title"), "Please log in to continue")
|
| ︙ |
Changes to ppdb/test/testuri.py.
| ︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
@cherrypy.expose
class Test(TestBase):
""" The test URI """
def GET(self):
""" A GET to the Test URI """
return "You requested some test function"
|
| ︙ |
Changes to ppdb/test/utests/test_audit.py.
| ︙ | |||
71 72 73 74 75 76 77 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - - - - - - |
def clear_history():
""" Clear the history table """
with pglib.get_conn():
with pglib.cursor() as curs:
curs.execute("delete from audit_history;")
|
| ︙ | |||
171 172 173 174 175 176 177 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - - - + + + |
@attr('A')
def test_aa1(self):
""" AA1 - INSERT to a table with autoincrement key and set_ts trigger """
TCases.old_reason = 'test_aa1'
TCases.gts_min = util.isots_now(True)
with pglib.get_conn():
with pglib.cursor() as curs:
|
| ︙ |
Changes to ppdrole.py.
| ︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - - - - + |
if not row:
print(f"No such role '{role}'")
return
with dbconn:
with dbconn.cursor() as curs:
|
| ︙ |