Script to get Snowflake Data Source User

For a script that connects with a Snowflake database, the authentication uses an externalbrowser. As this script is used by multiple people that are all connected to snowflake, I would like to take their User that they have filled in the Project Data Sources. Is there a way to get this information? The old way was via os.environ.get('SNOW_USER'), however this information is not saved anymore.

0
2 comments
It is stored in datasources.local.xml file of the project (or global datasources config if this is a global data source). See https://i.imgur.com/jJrDltC.jpg
0

Thanks! I'm using xml.dom.minidom to parse the file and get the right data. Is there a way to make sure in the parsing it just looks for ~\.idea\dataSources.local.xml, without peoples' own file path in place of ~?

0

Please sign in to leave a comment.