You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "xs996 (via GitHub)" <gi...@apache.org> on 2024/04/15 09:37:10 UTC

[I] Database password parsed failed [shardingsphere]

xs996 opened a new issue, #30896:
URL: https://github.com/apache/shardingsphere/issues/30896

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   ShardingSphere-5.4.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   The database password is parsed successfully using placeholder $${FIXTURE_PASSWORD::}
   ### Actual behavior
   Database password parsing failed using placeholder
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   ![image](https://github.com/apache/shardingsphere/assets/54011040/8414c1e5-cde1-42fd-9d28-7fb944ad50fa)
   According to the official documentation, I want to use a placeholder to replace my database password. When I try to do this, I fail. Where the data source is built, the placeholder information is read:
   ![image](https://github.com/apache/shardingsphere/assets/54011040/f28cda05-9baf-462c-b95d-af910493b15b)
   So I tried to modify the init of JDBCRepository and the build method of NewStandaloneContextManagerBuilder. By modifying the source code and testing, I successfully replaced my password with a placeholder, but the startup still reported an error.
   ![image](https://github.com/apache/shardingsphere/assets/54011040/4444e2fb-e5b4-4e1b-b580-1fa75eb3763c)
   If I want to continue to modify the source code, besides replacing my password in build and init, do I need to modify anything else?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2056757441

   - I'll see if this issue involves a bug in the master branch. To be honest though, you are using functionality on the 5.4.2-SNAPSHOT/5.5.0 milestone, which is obviously not available on 5.4.1.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2163811248

   Closed due to no response.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2058057830

   - Cannot be reproduced. And it does exist directly https://github.com/apache/shardingsphere/blob/master/test%2Fnative%2Fsrc%2Ftest%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Ftest%2Fnatived%2Fjdbc%2Fdatabases%2FMySQLTest.java and https://github.com/apache/shardingsphere/blob/master/test%2Fnative%2Fsrc%2Ftest%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Ftest%2Fnatived%2Fjdbc%2Fdatabases%2FOpenGaussTest.java uses placeholders for the jdbcUrl parameter.  
   
   - You need to provide unit tests.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "20001931 (via GitHub)" <gi...@apache.org>.
20001931 commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2106738128

   May i konw shardingsphere support ActiveDirectoryPassword authentication mode for SQLservice
   https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-using-azure-active-directory-authentication?view=sql-server-ver16#client-setup-requirements
   import java.sql.Connection;
   import java.sql.ResultSet;
   import java.sql.Statement;
   
   import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
   
   public class MSEntraUserPassword {
   
       public static void main(String[] args) throws Exception{
   
           SQLServerDataSource ds = new SQLServerDataSource();
           ds.setServerName("msentra-managed-demo.database.windows.net"); // Replace with your server name
           ds.setDatabaseName("demo"); // Replace with your database
           ds.setUser("bob@example.com"); // Replace with your user name
           ds.setPassword("password"); // Replace with your password
           ds.setAuthentication("ActiveDirectoryPassword");
   
           try (Connection connection = ds.getConnection();
                   Statement stmt = connection.createStatement();
                   ResultSet rs = stmt.executeQuery("SELECT SUSER_SNAME()")) {
               if (rs.next()) {
                   System.out.println("You have successfully logged on as: " + rs.getString(1));
               }
           }
       }
   }


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "xs996 (via GitHub)" <gi...@apache.org>.
xs996 commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2058088263

   > * I'll see if this issue involves a bug in the master branch. To be honest though, you are using functionality on the 5.4.2-SNAPSHOT/5.5.0 milestone, which is obviously not available on 5.4.1.
   
   My current version is 5.4.1 and does not have this test file. In other words, 5.4.1 does not support this feature. Do I need to upgrade my Shardingsphere version?
   ![image](https://github.com/apache/shardingsphere/assets/54011040/4aaefe32-d46a-4b53-a47b-ec0870f5d121)
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2106871108

   - @20001931 The answer is that no one has ever tested it, and the EULA of commercial databases such as MS SQL Server does not allow us to test it in depth. 
   - You need to provide git containing minimal reproducible unit tests in the new issue, that is, use testcontainers-java to create a docker image of SQL Server. **It doesn't make any sense for you to raise questions in random issues.**


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2058101477

   - If you need to test locally, you need to compile manually. 
   
   ```shell
   sdk install java 21.0.2-graalce
   sdk use java 21.0.2-graalce
   
   git clone git@github.com:apache/shardingsphere.git
   cd ./shardingsphere/
   git reset --hard ff0da07d640860b1c0668d5b22c361e0160f6aae
   ./mvnw clean install -Prelease -T1C -DskipTests -Djacoco.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
   ```
   - Obviously, in Maven.
   ```xml
   <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc</artifactId>
               <version>5.4.2-SNAPSHOT</version>
   </dependency>
   ```
   - Obviously, in Gradle.
   ```groovy
   repositories {
       mavenLocal()
       mavenCentral()
   }
   
   dependencies {
       implementation 'org.apache.shardingsphere:shardingsphere-jdbc:5.4.2-SNAPSHOT'
   }
   ```
   
   > Do I need to upgrade my Shardingsphere version?
   
   - This does not prevent you from pushing modules from your local maven repo to a private maven repo. Usually third-party tools will provide documentation, such as https://docs.gitlab.com/16.9/ee/user/packages/maven_repository/ . There are too many middleware and cloud services that can serve as Maven private repo, which usually involves redefining Maven GAV information in private projects.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian closed issue #30896: Database password parsed failed
URL: https://github.com/apache/shardingsphere/issues/30896


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Database password parsed failed [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #30896:
URL: https://github.com/apache/shardingsphere/issues/30896#issuecomment-2163808548

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org