Closed zg009 closed 2 weeks ago
@jeff-zucker If you'd like to pull this branch and see if it fulfills your needs, let me know. I can fix issues as they appear or don't resolve properly, but this will serve as the starting point.
@jeff-zucker If you'd like to pull this branch and see if it fulfills your needs, let me know. I can fix issues as they appear or don't resolve properly, but this will serve as the starting point.
The code looks right. I'll download and test tomorrow. Thanks much!
@zg009 Thanks. I think this is correct. You may make :
static registerHostName()
realWebId
--> webIdPathToPod
or podRelativeWebId
or webIdRelToPodRoot
not easy to explain. The intention is to get the WebId relative to pod Root/profile/card#me
@bourgeoa I addressed your first and second point. I need more clarity about what I need to check in the test suite.
Your code works but I think (to be discussed) it does not respect the actual code logic (I did not create it nor help maintain this part)
I thin k your function should be implemented here https://github.com/nodeSolidServer/node-solid-server/blob/07ee53cc3857fa050232cc7723f7a7abd440dc13/lib/models/account-manager.js#L67
To avoid
@bourgeoa Are you saying in the static from method, move the logic from current changes into the from method and set the 'host' variable in that way?
Yes but I am not sure of me at all
I was thinking that from was returning all data needed from input
The only places I see AccountManager and AccountTemplate interacting is here https://github.com/nodeSolidServer/node-solid-server/blob/07ee53cc3857fa050232cc7723f7a7abd440dc13/lib/models/account-manager.js#L390-L402
If you trace AccountTemplate.for(), it is the only code which uses AccountTemplate.templateSubstitutionsFor().
I could modify the AccountTemplate.for method to take hostname from AccountManager object from AccountManager.createAccountFor.
EDIT: Actually, looking at the code further, the same end goal is reached. I do not have strong feelings about where to move the host server checking logic. It seems logical to pass hostname to AccountTemplate.for and change webId path based upon that.
To improve cleaning the logic this should be moved :
https://github.com/nodeSolidServer/node-solid-server/blob/18b7cb3c0b6506554365be66bcbd1771807d2946/lib/create-app.js#L56
inside function initWebId
And may be passed via accountManager
with a new parameter argv.serverUri
to the API.accounts.middleware()
app.use('/', API.accounts.middleware(accountManager))
I wonder if there is a situation where there is any difference between registerHostname()
and
https://github.com/nodeSolidServer/node-solid-server/blob/18b7cb3c0b6506554365be66bcbd1771807d2946/lib/models/account-manager.js#L156
What do you think ? May be with external WebId ?
I marked it as draft because it is not working. I think the logic is more complex between
The podUri is not stored in userAccount. May be look at rootAclUri
Yeah, I figured this wouldn't be so simple. I'll have some time to take a deeper dive later this week or early June, I am busy with my current work right now.
It is the first time I go in the logic of the account manager of NSS code. Anyway thanks for looking.
Yeah, I figured this wouldn't be so simple. I'll have some time to take a deeper dive later this week or early June, I am busy with my current work right now.
Thanks much for looking in to it. I do not see this as in any way high priority and can deal with it in other ways, so there is no rush on my account. And I can't think that's priority for others either.
@jeff-zucker I agree it is not high priority. But when you get in, and thinks it is quite simple and don't find the code logic you somehow are frustrated.
@zg009 I think I resolved it. Thanks again for your help. Could you :
/profile/card#me
should use predefined constants @jeff-zucker I agree it is not high priority. But when you get in, and thinks it is quite simple and don't find the code logic you somehow are frustrated.
@zg009 I think I resolved it. Thanks again for your help. Could you :
- replace failing tests and add any needed ones
/profile/card#me
should use predefined constants
You will need to clarify what predefined constants I should be using for these tests.
This is not in the tests, but to improve the code to use https://github.com/nodeSolidServer/node-solid-server/blob/1034123e268365230342894db825f8f419af1b32/lib/models/account-manager.js#L50-L51
in place of /profile/card#me
@bourgeoa I edited your function a little bit because the webID document was including port. If this is unintended behavior I can revert. I also added one test case. If you want to see other test cases, let me know.
@bourgeoa I edited your function a little bit because the webID document was including port.
Yes, this is important, users ought to be able to change the port of the server without having to recreate an account.
replaced wirh url.origin and updated tests that should have failed on relative webId and did not.
@bourgeoa Looks better to me, I had the wrong idea about which tests should pass
@bourgeoa Is this good to merge?
This is the thread for addressing #1783
Current has some work to register hostname on server creation and apply it to AccountTemplate class as a static variable
Ran some tests with localhost webId resolution.
Integration tests probably need more granularity, also strategy to handle multiuser mapping due to prefix path rather than postfix.