Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

OT - Credential Property broken ?



  • Hi,
    Bug or not ?
    it seems it is no longer possible to get Password from Secure Credentials.
    It is not possible to read the Password from Secure Credential
    Same result if OtterScript usage is unchecked (tested just in case ...)

    • Create a secure crednetial as "Username & Password" and allow OtterScript usage
      6a080e1f-6b10-4f45-9d55-47f6058d69d6-image.png

    • Create an otter script

      set $CredentialUser = $CredentialProperty(svc-inedo, Username);
      set $CredentialPwd = $CredentialProperty(svc-inedo, Password);
    

    306927a6-72d1-48ea-926d-118003c852f6-image.png

    This was working on OT v2.2.23 / tested OT v2022.10

    Best regards
    PhilippeC.


  • inedo-engineer

    Hi @philippe-camelio_3885,

    Looking at the code for v2022.10, there is nothing apparent that sticks out to why this wouldn't work. Just to verify, you do not have any other credentials (or legacy credentials) with the same name do you? The only thing that I see in the code would be due to how things are returned and sorted by the function, if there would happen to be two credentials with the same name, it may return the wrong credential which would have the wrong value set.

    Thanks,
    Rich



  • I understand.
    I checked twice and found nothing in double.

    I created a new Credential test. ==> Same problem. I don't see what I am doing wrong 😞

    otter script very simple:

      set $CredentialUser = $CredentialProperty(test, Username);
      set $CredentialPwd = $CredentialProperty(test, Password);
    

    also tried with :

     set $CredentialUser = $SecureCredentialProperty(test, Username);
     set $CredentialPwd = $SecureCredentialProperty(test, Password);
    

    to be more complete, this the docker version


  • inedo-engineer

    Hi @philippe-camelio_3885 ,

    I can't reproduce this at all....

    1. Admin > Secrure Credentials> Create
    2. test with Username = myuser, PAssword = mypass, check "function usage allowed"
    3. Create script Credtest.otter with contents below
    4. Run as Ad-hoc job on local host <-- works OK
    5. Admin > Secure Credentials, uncheck function allowed
    6. Run as Ad-hoc job on local host <-- failed as expected
    7. Admin > Secure Credentials, check function allowed
    8. Run as Ad-hoc job on local host <-- works OK

    So it seems to be working as expected. And as Rich mentioned, the code seems fine and hasn't been changed.

    Here's the script:

     set $CredentialUser = $SecureCredentialProperty(test, Username);
     set $CredentialPwd = $SecureCredentialProperty(test, Password);
    
     Log-Information User is $CredentialUser, Password is $CredentialPwd;
    


  • 😥
    I have done exactly what you did and the pb is still there.
    I really don't understand.

    Next week, I'll make a test on fresh install and I will update the thread.

    Thanks for your time
    Best regards
    PhilippeC.


  • inedo-engineer

    @philippe-camelio_3885 thanks for confirming that it was broken, I took a closer look and figured it out :)

    It will be shipped in the next maintenance release as OT-492 (and also in BuildMaster via BM-3846)



  • @atripp said in OT - Credential Property broken ?:

    or confirming that it was broken, I took a closer look and figured it out :)

    I made new test form fresh install

    • 22.0.10 -> test OK
    • 22.0.9 -> OK
    • update 22.0.9 to 22.0.10 -> test OK

    I don't understand why the instance I am working on is not ok.
    There is no bug, I apologized .

    I will restart a new fresh instance and i reimport what I have already done.

    Thanks for you time


  • inedo-engineer

    Hi @philippe-camelio_3885 , there's definitely a bug... it was just hard to reproduce.

    The issue was the Otter was looking at the wrong credential to determine if function access was allowed...



  • 👍
    I thought I was wrong


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation