Skip to content

feat: network policies - #159

Merged
sgbalogh merged 4 commits into
mainfrom
devin/1795043388-network-policies
Nov 18, 2026
Merged

sgbalogh merged 4 commits into
mainfrom
devin/1795043388-network-policies

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds network policies, which restrict where an access token may be used from.

  • S2.list_network_policies, list_all_network_policies, create_network_policy, get_network_policy, delete_network_policy.
  • network_policy on issue_access_token() (slug or full <slug>.<nonce> reference) and on AccessTokenInfo (full reference).
  • Operation gains the four network policy operations for token scoping.
policy = await s2.create_network_policy(
    "office",
    policy=NetworkPolicy(public_net=PublicNetCidrs(["203.0.113.0/24"])),
)
await s2.issue_access_token("ci", scope=scope, network_policy=policy.id)

NetworkPolicy.public_net is PublicNetCidrs | Unknown | None and private_net is AwsPrivateNetPolicy | Unknown | None; a kind this SDK version does not know parses as Unknown(kind).

The e2e test carries the access_tokens marker so the s2-lite run, which does not implement network policies, skips it. It does not compare created_at between the create and get responses, which the service returns with slightly different values.

Link to Devin session: https://app.devin.ai/sessions/6bae76d9f8bd40a3ab56877ebab2af97
Open in Devin Desktop: https://app.devin.ai/desktop/session/6bae76d9f8bd40a3ab56877ebab2af97?variant=devin
Requested by: @sgbalogh


🟢 Devin Review found nothing to fix · View findings

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

sgbalogh and others added 2 commits November 18, 2026 23:12
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sgbalogh
sgbalogh marked this pull request as ready for review November 18, 2026 23:21
@sgbalogh
sgbalogh requested a review from a team as a code owner November 18, 2026 23:21

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge based on the code available for review.

Summary

Adds account-level network policies and lets callers bind access tokens to them.

  • Account callers can create and manage network policies.
  • Issued access tokens can be limited to a chosen network policy.

No actionable issues found. Tests were not run. The specification submodule was empty, and access to the related TypeScript and Go repositories was denied, so cross-SDK contract checks remain incomplete.

Reviews (1) · Last reviewed commit: "test: do not compare created_at across c..." · Reviewed by Greptile

@sgbalogh
sgbalogh merged commit 232b216 into main Nov 18, 2026
8 checks passed
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.

1 participant