Validate the permissions configuration
(ctx: click.Context)
| 169 | @feast_permissions_cmd.command(name="check") |
| 170 | @click.pass_context |
| 171 | def feast_permissions_check_command(ctx: click.Context): |
| 172 | """ |
| 173 | Validate the permissions configuration |
| 174 | """ |
| 175 | from tabulate import tabulate |
| 176 | |
| 177 | all_unsecured_table: list[Any] = [] |
| 178 | store = create_feature_store(ctx) |
| 179 | permissions = store.list_permissions() |
| 180 | objects = cli_utils.fetch_all_feast_objects( |
| 181 | store=store, |
| 182 | ) |
| 183 | |
| 184 | print( |
| 185 | f"{Style.BRIGHT + Fore.RED}The following resources are not secured by any permission configuration:{Style.RESET_ALL}" |
| 186 | ) |
| 187 | for o in objects: |
| 188 | cli_utils.handle_permissions_check_command( |
| 189 | object=o, permissions=permissions, table=all_unsecured_table |
| 190 | ) |
| 191 | print( |
| 192 | tabulate( |
| 193 | all_unsecured_table, |
| 194 | headers=[ |
| 195 | "NAME", |
| 196 | "TYPE", |
| 197 | ], |
| 198 | tablefmt="plain", |
| 199 | ) |
| 200 | ) |
| 201 | |
| 202 | all_unsecured_actions_table: list[Any] = [] |
| 203 | print( |
| 204 | f"{Style.BRIGHT + Fore.RED}The following actions are not secured by any permission configuration (Note: this might not be a security concern, depending on the used APIs):{Style.RESET_ALL}" |
| 205 | ) |
| 206 | for o in objects: |
| 207 | cli_utils.handle_permissions_check_command_with_actions( |
| 208 | object=o, permissions=permissions, table=all_unsecured_actions_table |
| 209 | ) |
| 210 | print( |
| 211 | tabulate( |
| 212 | all_unsecured_actions_table, |
| 213 | headers=[ |
| 214 | "NAME", |
| 215 | "TYPE", |
| 216 | "UNSECURED ACTIONS", |
| 217 | ], |
| 218 | tablefmt="plain", |
| 219 | ) |
| 220 | ) |
| 221 | |
| 222 | |
| 223 | @feast_permissions_cmd.command(name="list-roles") |
nothing calls this directly
no test coverage detected