Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: Use const values to handle layout / entries well known values and generate strings instead of hardcoding them #626

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Commits on Nov 26, 2024

  1. brokers: Move auth results to auth package so that can be used everyw…

    …here
    
    We were duplicating this in the example broker, so let's make the same
    content be available everywhere.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    f1e5e07 View commit details
    Browse the repository at this point in the history
  2. cleanup: Define layout type names as constants and reuse them in code

    Avoid (re)using string values for layout types as is, since they are
    prone to errors and they're hard to maintain.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    96a0fce View commit details
    Browse the repository at this point in the history
  3. cleanup: Define entries names as constants and reuse them in code

    Avoid (re)using string values for entries types as is, since they are
    prone to errors and they're hard to maintain.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    a8a4e0d View commit details
    Browse the repository at this point in the history
  4. brokers/layouts: Add simple formatter for optional/required items

    Avoid building the list manually now that we've consts values and use
    this for both optional booleans and supported entries
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    11125b2 View commit details
    Browse the repository at this point in the history
  5. brokers/layouts: Add parser for joined layout items

    It can be used to parse optional or required values or entries.
    
    Use this both in broker and example brokers logic
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    2dcd274 View commit details
    Browse the repository at this point in the history
  6. cleanup: Use layouts.True instead of strings

    Avoid repeating the same string allover the places
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    b64d869 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a75ec45 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b6f86e9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e1c18d3 View commit details
    Browse the repository at this point in the history
  10. examplebroker: Simplify auth modes handling by using a maps of structs

    We were using a maps of maps that made code hard to read and maintain
    and doing some unneeded conversions to json back and forth.
    
    Avoid this by just using structured data instead
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    aa5ad2d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e8a76c8 View commit details
    Browse the repository at this point in the history
  12. examplebroker: Define authentication modes we support globally

    So that we can reuse their ID across the file without further constants
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    ecfe7d6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6a47a3a View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4617a9a View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    3188862 View commit details
    Browse the repository at this point in the history
  16. cleanup: Move authd protocol definitions to internal library

    We don't need to expose the proto externally, since we are now re-usable
    so if something of it has to be exposed we should do it manually
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    04cce75 View commit details
    Browse the repository at this point in the history
  17. services/pam: Set qrcode rendering to false if the flag is false

    It's what the oidc broker expects to be set in case the rendering is not
    supported, while we were unsetting the value by default.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    6d67ab9 View commit details
    Browse the repository at this point in the history
  18. brokers/layouts: Add functions to create UILayout definitions and par…

    …se them
    
    We use to create UI options manually and converting them to maps for
    being transferred via DBus, it's something we also need to do in the
    broker side, so let's expose this publicly for being reused by brokers
    too
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    44c2f42 View commit details
    Browse the repository at this point in the history
  19. brokers/layouts: Do not include unset values on string maps objects

    If some values are unset, there's no point to expose them to the brokers
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    06d6b8d View commit details
    Browse the repository at this point in the history
  20. cleanup: Use layouts to create layouts for tests

    Now that it has been tested with the manually generated version we can
    use the utility functions.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    a30d228 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    f4231f0 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    8055c8b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    3f27057 View commit details
    Browse the repository at this point in the history
  24. brokers/layouts: Add simple functions to parse lists of layout maps

    It can be useful for brokers to handle the received messages
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    fa7fe3e View commit details
    Browse the repository at this point in the history
  25. examplebroker: Use native layouts.UILayout to parse the supported UI …

    …layouts
    
    It adds a convenient way to handle the value as a native type.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    ec4c3b2 View commit details
    Browse the repository at this point in the history
  26. brokers/auth: Add authentication Mode abstraction utilities

    These can be used by brokers and authd to parse the results back and
    forth from the dbus format.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    4a8d440 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    be8d273 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    ee38984 View commit details
    Browse the repository at this point in the history
  29. examplebroker: Move to internal package

    Now that authd can be imported we should not expose anything that isn't
    an API.
    3v1n0 committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    8d7abc1 View commit details
    Browse the repository at this point in the history