Skip to content

Modify configuration data structure #2

@mdugas

Description

@mdugas

Is your feature request related to a problem? Please describe.
In the current implementation, when a user attempts to grab the configuration for a given server, the code runs a for loop to fetch the config mapping for that server. Then it uses this to verify if this server is in the users groups. This works, but comes at the cost of extra CPU cycles than if we would be taking the server configuration directly.

Describe the solution you'd like
An idea I got so far is to change the behavior so the steps happens as follows

  1. Modify the data structure to be a 2-layer dictionary (server_mappings[server_name][config_option])
  2. Before grabbing the code verify if the requested server is in the list (if server in server_mappings)
  3. Verify if server group mapping is in the users allowed list (if goup_mapping in users_groups)

Describe alternatives you've considered
Nil so far

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions