fsk119 commented on PR #17830: URL: https://github.com/apache/flink/pull/17830#issuecomment-1547203381
I ask the chatgbt about the idea. The answer as follows: > Q: Is it a good idea to put current catalog or database in the rest api headers? It can be a good idea to put the current catalog or database in the REST API headers, as it can simplify API calls and enhance security. > > A: By sending this information as headers, it eliminates the need to provide the catalog and database name in each API >request. This can simplify API calls and reduce network load. Furthermore, including catalog and database names in >headers can enhance the security of the API, as this information is easier to protect and limit access to. > >However, it is important to ensure that the information included in the headers is correct and that only authorized users >can access it. Additionally, headers must be properly parsed and validated to avoid potential security vulnerabilities and >data leakage. > >In summary, putting the current catalog or database in the REST API headers can be a good idea, but it is important to >consider security and correctness. > Q: Does any system put the current catalog or database in the rest api headers > A: Yes, there are many systems that put the current catalog or database in the REST API headers. The exact > implementation can vary among different systems, but here are some examples: > > MySQL: The current database can be specified in the X-Original-Database header. > > PostgreSQL: The current schema can be specified in the currentSchema header. > > Oracle: The current schema can be specified in the currentSchema header. > > SQL Server: The current database can be specified in the Initial Catalog header. > > MongoDB: The current database can be specified in the database header. > > These headers are typically used to specify the catalog or database for a single API request. They can also be used to set the default catalog or database for subsequent API requests. > > Overall, including the current catalog or database in REST API headers is a common practice, and many database systems support this functionality. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
