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

ASM API Update - Add subdomain endpoints #177

Merged
merged 4 commits into from Oct 7, 2021
Merged

ASM API Update - Add subdomain endpoints #177

merged 4 commits into from Oct 7, 2021

Conversation

ghost
Copy link

@ghost ghost commented Oct 6, 2021

This changeset adds access additional subdomain endpoints:

Underneath the main api:

  • /v1/assets/domains/:domain/subdomains/:subdomain
    • GET: read subdomain details
    • /comments (POST: create comment, GET: list comments)
    • /comments/:commentId (GET: get single comment|DELETE: delete single comment)
    • /tags (POST: create tag)
    • /tags/:tagId (DELETE: delete single tag)

These are done by obtaining an instance representing the top-level domain that you will manipulate subdomains for:

client = AsmClient()

subdomains = client.get_subdomains("my_domain.com")

details_object = subdomains.get_asset_by_id("sub.my_domain.com")

subdomains.add_tag("sub.my_domain.com", "new tag")
subdomains.delete_tag("sub.my_domain.com", "new tag")

comments_page = subdomains.get_comments("sub.my_domain.com")
subdomains.add_comment("sub.my_domain.com", "new comment")
subdomains.delete_comment("sub.my_domain.com", "new comment")
subdomains.get_comment_by_id("sub.my_domain.com", 3)

@thehappydinoa thehappydinoa requested a review from a team October 6, 2021 17:19
Copy link
Member

@thehappydinoa thehappydinoa left a comment

Choose a reason for hiding this comment

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

Hey @thomas-censysio could I ask you to rebase from main? I fixed the CI config to work for external PRs.

censys/asm/client.py Outdated Show resolved Hide resolved
@thehappydinoa thehappydinoa merged commit 07fe23f into censys:main Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants