Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-21280

azure-files: Only CredentialType.SHARED_ACCOUNT_KEY is handled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.7.0, 4.8.0
    • 4.8.1, 4.9.0
    • camel-azure
    • None
    • Unknown

    Description

      In FilesOperations the client builder only handles the SHARED_ACCOUNT_KEY CredentialType, the others are misplaced under that if:

       

      if (configuration.getCredentialType().equals(CredentialType.SHARED_ACCOUNT_KEY)) {
          if (sharedKey != null) {
              var keyB64 = FilesURIStrings.reconstructBase64EncodedValue(sharedKey);
              builder.credential(new StorageSharedKeyCredential(configuration.getAccount(), keyB64));
          } else if (configuration.getCredentialType().equals(CredentialType.AZURE_SAS)) {
              builder = builder.sasToken(token.toURIQuery());
          } else if (configuration.getCredentialType().equals(CredentialType.AZURE_IDENTITY)) {
              builder = builder.credential(new DefaultAzureCredentialBuilder().build());
          }
      } 

      Fix should be easy:

      if (configuration.getCredentialType().equals(CredentialType.SHARED_ACCOUNT_KEY) && sharedKey != null) {
          var keyB64 = FilesURIStrings.reconstructBase64EncodedValue(sharedKey);
          builder.credential(new StorageSharedKeyCredential(configuration.getAccount(), keyB64));
      } else if (configuration.getCredentialType().equals(CredentialType.AZURE_SAS)) {
          builder = builder.sasToken(token.toURIQuery());
      } else if (configuration.getCredentialType().equals(CredentialType.AZURE_IDENTITY)) {
          builder = builder.credential(new DefaultAzureCredentialBuilder().build());
      } 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              s.clauw Sven
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: