Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npm test" result seems wrong #74

Open
iaoiui opened this issue Jan 16, 2019 · 1 comment
Open

"npm test" result seems wrong #74

iaoiui opened this issue Jan 16, 2019 · 1 comment

Comments

@iaoiui
Copy link
Contributor

iaoiui commented Jan 16, 2019

I tried to execute "npm test" and got following result.

  Sanity Checks for Wilma PEP Proxy - Identity Manager Checks
    Testing Keystone configuration
      1) should have PEP user configured
    Testing connection with Keystone
2019-01-16 22:52:32.352  - ERROR: Test - Error in keystone communication {"error":{"message":"Expecting to find X-Auth-token in requests","code":400,"title":"Bad Request"}}
      2) should have connectivity with Keystone
2019-01-16 22:52:34.360  - INFO: IDM-Client - IDM authorization configuration:
2019-01-16 22:52:34.360  - INFO: IDM-Client -  + Authzforce enabled: false
2019-01-16 22:52:34.361  - INFO: IDM-Client -  + Authorization rules allowed: HTTP Verb+Resource

both test 1 and 2 failed.

test 1 checks pep config is set properly like following code:

describe('Testing Keystone configuration', function() {

                it('should have PEP user configured', function (done) {
                        if (config.pep.username !== undefined && config.pep.username !== '') {
                                if (config.password !== undefined && config.password !== '') {
                                        done();
                                }
                        }
                });
        });

solution for test 1

This code checks "config.password" variable but should check "config.pep.password",right?

test 2 checks communication between pep and Keyrock without auth.

This test send request to <keyrock_ip>:keyrock:port/v3.
However the request sent to this endpoint must be set "x-auth-token" header.

const checkConn = function(callback, callbackError) {

        const options = {
            host: config.idm.host,
            port: config.idm.port,
            path: '/v3',
            method: 'GET'
        };
        const protocol = config.idm.ssl ? 'https' : 'http';
        proxy.sendData(protocol, options, undefined, undefined, callback, callbackError);
    };

solution for test2

To check whether Keyrock return status code 200, /version endpoint is suitable, right?
I confirmed the communication test passed properly.

If you agree these changes, I would create pull request.

@iaoiui
Copy link
Contributor Author

iaoiui commented Jan 16, 2019

I created pull request #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant