Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Network ACLs + list_networks #554

Closed
wants to merge 68 commits into from
Closed

Conversation

kylehogan
Copy link
Contributor

@kylehogan kylehogan commented Mar 15, 2016

functionality to list all networks from #519
depends on #545 as the access parameter for networks was changed

this closes #519, #545, #520, #453, and possibly #496

the functionality for showing connected nodes is outside of show_network() currently, but could be implemented there instead

also affects #566, in a negative way

}

def test_list_network_attachments(self, db):
api.node_register('node-99', 'ipmihost', 'root', 'tapeworm')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any ideas on why this is failing the Travis checks?
getting a type error that node_register takes only one argument
I am not getting the same error locally and none of the other tests are failing with this line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SahilTikale - does the OBM IPMI change we just merged require a
different config file to load the correct drivers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was a change to the node_register call that was required by the OBM IPMI change - I didnt have it locally so I didnt run into the issue there and all the other tests were getting fixed by git when it merged.

I just changed my calls to node_register to match the new syntax and it was fine


`POST /project/<project>/add_network`

Add a network to project named <project>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you reflect that you are adding access to a network for this and project_remove_network?

@kylehogan
Copy link
Contributor Author

@xuhang57 Lucas, would you mind reviewing this since the list_networks code is yours? I made a few small changes because of the many to many project:network relationship and that public networks should have project access be 'None', but everything else should be the same.

@xuhang57
Copy link
Contributor

Thanks a lot Kyle! @kylehogan And it looks good to me and I agree with you that we should set them as 'None', which you have already fixed.

@kylehogan
Copy link
Contributor Author

There is an issue with the ownership of admin created networks now that a network can be accessed by multiple projects.

I believe that the original intent was that if an admin created a network with access 'project1' then project1 would effectively be the 'owner' of the network.
Now that access is a list, all projects in the list have equal access rights to the network, but some functions such as adding a project to the network access list should only be allowed by an admin or the project that 'owns' the network.

If a network was created by a project then the owner is obviously network.creator, but for admin created networks I don't think restricting these functions to admin users is in line with what was originally intended by having an admin create a network to be accessed by a project.

I think it would make sense to have network specific admins to allow there to be a distinction between projects that are allowed to access the network and projects that are allowed to grant/remove access for other projects or delete the network etc.

@kylehogan
Copy link
Contributor Author

done pending review+discussion

@shuwens
Copy link
Contributor

shuwens commented Aug 16, 2016

@henn carefully remind you that your hil is also outdated, don't know whether or not this could help solve the branch conflict yet.

@shuwens
Copy link
Contributor

shuwens commented Aug 17, 2016

@henn I dont think the last 2 commit should be here, we have to get rid of it after all.

if project is None:
# List all nodes connected to network.
# Only the project that owns the network should be able to list attached nodes
auth_backend.require_project_access(network.owner)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe network.owner can be None, which denotes admin ownership

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Originally, I was expecting #636 to land first, which would have allowed None. Now that we aren't doing that, I'll have fix this.

@henn
Copy link
Contributor

henn commented Aug 17, 2016

@shwsun - you're right. I got rid of the 2 travis CI commits.

henn added 2 commits August 19, 2016 01:58
Currently, the server side isn't accepting the GET arguments,
but this should pass them correctly.
@henn
Copy link
Contributor

henn commented Aug 19, 2016

Note that the code for passing GET arguments from the CLI, a13d140, should be code reviewed under #643.

If changes happen there, I'll bring them over to this branch too.

@henn
Copy link
Contributor

henn commented Aug 19, 2016

Also, for functionality of the optional GET argument in list_network_attachments(), this depends on #644.

@henn henn mentioned this pull request Aug 19, 2016
@gsilvis
Copy link
Contributor

gsilvis commented Aug 23, 2016

This is listed as waiting on +2, but it has merge conflicts.

@gsilvis
Copy link
Contributor

gsilvis commented Aug 23, 2016

Also, it has /sixty-eight/ commits, eight of which are internal merge commits, and quite a few of which are typo fixes that shouldn't have their own commits.

@zenhack
Copy link
Contributor

zenhack commented Aug 24, 2016

Indeed, some rebasing/squashing would not go amiss.

@henn
Copy link
Contributor

henn commented Sep 2, 2016

FYI - since some merging is necessary, the plan discussed between
myself, @pjd-nu and @shwsun is to close this over the next few days and
create a new PR that has this branch merged with the latest master, with
some portion of the commits squashed.

Indeed, some rebasing/squashing would not go amiss.

@zenhack
Copy link
Contributor

zenhack commented Sep 5, 2016

@henn, sounds good to me.

@naved001
Copy link
Contributor

Hi @henn is this pull request still active, or will a new pr be created with this branch merged? Thanks!

@zenhack
Copy link
Contributor

zenhack commented Sep 30, 2016

Spoke to @henn about the next things for me to work on, first thing on the list is getting this sorted out. I've got a branch on which I'm working on resolving the conflicts and cleaning up the history; I'll open a new pr once it's worth a look. I'm going to close this one.

@zenhack zenhack closed this Sep 30, 2016
@zenhack zenhack mentioned this pull request Oct 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants