Kat, the Keycloak Analysis Tool, assists with understanding the workings of Keycloak.
Kat provides information about the Keycloak database structure.
This tool has been developed and tested against the following components.
- Keycloak version 5.0.0
- MariaDB database version 10.3
- phpMyAdmin version 4.6 (to export the Keycloak database structure)
Add this line to your application's Gemfile:
gem 'kat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kat
From phpMyAdmin:
- keycloak database
- Export tab
- Export method: Custom - display all possible options
- Tables:
- all tables should have Structure checked
- all tables should have Data unchecked
- Output: Save output to a file
- Character set of the file: utf-8
- Compression: none
- Format specific options: Display comments
- Object creation options: only the following items should be checked:
- AUTO_INCREMENT value (under Add CREATE TABLE statement)
- Enclose table and column names with backquotes
- "Go" button to download the SQL file
To test processing of an SQL file generated by a myPhpAdmin export of the database structure, use the following command.
$ kat read sample/keycloak-5.0.0-mariadb-phpmyadmin.sql --log_level INFO
where keycloak.sql is the SQL file generated by myPhpAdmin. The log_level parameter can be used to receive additional log information (default is WARN; see Logger documentation for additional values.)
If no errors are encountered, kat will display the number of tables and constraints found.
To see the tables and constraints, use the following command.
$ kat read sample/keycloak-5.0.0-mariadb-phpmyadmin.sql --log_level ERROR
- The SQL processor does not support constraints containing multiple foreign keys or multiple references. The Keycloak database as of version 5.0.0 does not use such constraints.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/sutch/kat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Kat project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.