<@ULVA73B9P> What's the best way to store a client...
# ask-marvin
k
@Marvin What's the best way to store a client ID and secret in a block? Currently I have one block for the client ID and another block for the client secret. Can I combine them into one block?
m
It seems there are no direct instructions in the Prefect documentation regarding the combination of a client ID and client secret into one block. However, the general idea conveyed by the Prefect blog and documentation suggests that blocks can hold multiple configuration values and be programmed with business logic. Therefore, it is likely possible to combine a client ID and client secret into one block, especially since blocks are designed to support different types of configuration and secrets management. For detailed implementation, this would typically involve defining a custom block schema to encapsulate both values. To create a new block with your desired configuration: 1. Navigate to the blocks page in your Prefect UI or use the Prefect CLI. 2. Click the "+" at the top to create a new block or use the
block create
command in the CLI. 3. Choose an appropriate block type or define a custom block schema to hold your client ID and client secret. 4. Fill out the necessary fields with your client ID and client secret. 5. Save the block with the combined information. If you are working with sensitive information like client secrets, be sure to follow best practices for storing secrets in Prefect, including using the appropriate blocks designed for secure storage and access control. For more information, you may refer to the resources linked: - Prefect Global Coordination Plane: Prefect Blog - Guide on Push Work Pools: Prefect Docs - Deployment - Prefect Security Practices: Prefect Security If you still have doubts or specific questions about the implementation, referring to the Prefect community or support would be advisable.
j
You could make your secret a string that is valid JSON and load it to a dictionary in order to pull the specific values out or, if the keys are set to the same name as the parameter of the function that needs the values, pass the dictionary in as **kwargs.