Skip to content

Added Subnet and IP in the Vpn list and Vpn detail APIs #1005

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

marino-mrc
Copy link

Added 'subnet' and 'ip' fields in the /controller/vpn/ and /controller/vpn/${id} get requests

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #1003

Description of Changes

Changed the Meta calss inside the VpnSerializer class in order to add 'subnet' and 'ip' fields

Added 'subnet' and 'ip' fields in the /controller/vpn/ and /controller/vpn/${id} get requests
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

Will look into it asap.

Added the "vpnclient_config" object inside the "config" object when the "controller_device_read" api is called. It's useful to see the ip addresses assigned to a device when connected to a wireguard vpn
@marino-mrc
Copy link
Author

Hi @nemesifier ,
I'm sorry, yesterday I messed up my pull request by adding a new commit to fix another missing part in APIs.
Please, if you think the both commits are valid let me know. I'm happy to start new pull requests and try to merge.

I'm using Openwisp API as part of a personal project and I'm happy to contribute (even though I've a very limited availability)

Thanks,
Marco

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

@marino-mrc thanks for contributing!

I think before the change was quite clear, now it's not very clear what the intended outcome is and I am not sure we can merge it as is.

Keep in mind that if you need to customize the behavior of OpenWISP, changing the core code is not the right approach, you can create a sub app in your django project and extend the API views of OpenWISP, replacing a specific URL with your custom view.

This way your extension becomes more maintainable.

marino-mrc and others added 3 commits April 24, 2025 17:47
Fixed the problem when a vpn_client template is removed from the configuration of a specific device
Added the possibility to set webhook_endpoint and auth_token when calling a POST on /controller/vpn (the type must be wireguard)
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

Successfully merging this pull request may close these issues.

Vpn APIs don't show subnet details
2 participants