add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

add secrets forwarding requests teams mle - #77

Open
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle
Open

add secrets forwarding requests teams mle#77
christian-method wants to merge 7 commits into
masterfrom
add-secrets-forwarding-requests-teams-mle

Conversation

@christian-method

@christian-methodchristian-method commented Aug 5, 2026

Copy link
Copy Markdown

Closing the High Priority Gaps from 2025-07-05 Monthly Diff Report

Added Secrets, ForwardingRequests, and Teams MLE public key resources
Added ManagedAccounts, complete Teams, and update account subscription types

Failing pytests are pre-existing this change.

christian-methodand others added 3 commits August 4, 2026 18:01
Implements the resources the API docs already show Python examples for:
- method.secrets: create, retrieve, list, delete
- method.forwarding_requests: create, retrieve
- method.teams.mle.public_keys: create, list, retrieve, delete
Response types follow octo's public types (ForwardingRequest carries
status_history and no updated_at; headers/body are required on create,
matching the API's inbound validation).
Integration tests follow the existing live dev-API pattern. The
ForwardingRequest create tests are skipped pending a whitelisted
destination URL and payment instrument (see skip reasons).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types
Closes out the remaining HIGH priority SDK gaps:
- method.managed_accounts: list, retrieve, and per-account transactions
(field shapes follow octo's public types; the node SDK's stale shapes
were not carried over)
- method.teams: list (GET /teams returns sub-teams), create, and
update_encryption_key (opts match octo's validators: create requires
name/legal_name/ein/contacts; encryption key takes an RSA modulus and
exponent pair or a certificate)
- Account subscription types gain attribute, payment_instrument.card,
and payment_instrument.network_token (connect and credit_score are
entity-level subscriptions and already exist on Entities)
Team create and encryption key tests are skip-marked: both mutate
shared dev-environment state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Secret responses include an error field (null when healthy); add it to
the Secret TypedDict and test expectations
- The MLE public key endpoint only accepts jwk.alg RSA-OAEP-256; the
test JWK used RS256, which the API rejects with a 400
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@christian-method
christian-method marked this pull request as ready for review August 7, 2026 19:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:92289c51b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadmethod/method.py
Resolves Codex review comment: the new secrets, forwarding_requests, and
teams.mle.public_keys resources are documented under Method-Version
2025-12-01, and the versioning docs pin method-python v2.1.0+ to that
version. Also adds the split payment_instrument product names introduced
by 2025-12-01 to the Account product literals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 25, 2026 20:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new public API resources to the Method Python SDK (Secrets, ForwardingRequests, Teams/Team MLE public keys, ManagedAccounts) and updates account subscription/product type literals to align with newer API surface (method-version 2025-12-01).

Changes:

  • Introduces new resource clients and types: secrets, forwarding_requests, teams (including teams.mle.public_keys), and managed_accounts.
  • Adds integration-style pytest modules exercising the new resources.
  • Updates account product/subscription literal types and bumps the method-version request header.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
FileDescription
test/resources/TeamMLEPublicKey_test.pyAdds live API tests for teams.mle.public_keys create/list/retrieve/delete.
test/resources/Team_test.pyAdds team list test plus skipped tests for create and encryption key mutation.
test/resources/Secret_test.pyAdds live API tests for secrets create/retrieve/list/delete.
test/resources/ManagedAccount_test.pyAdds managed account list/retrieve/transactions tests with optional env-provided ID.
test/resources/ForwardingRequest_test.pyAdds forwarding request tests (skipped by default) and setup fixture.
method/resources/Teams/Team.pyImplements Teams resource plus nested MLE public keys resources and related TypedDicts.
method/resources/Teams/init.pyExposes Teams resource/types at the package level.
method/resources/Secrets/Secret.pyImplements Secrets resource and related TypedDicts.
method/resources/Secrets/init.pyExposes Secrets resource/types at the package level.
method/resources/ManagedAccounts/ManagedAccount.pyImplements ManagedAccounts resource, subresource call pattern, and transactions listing.
method/resources/ManagedAccounts/init.pyExposes ManagedAccounts resource/types at the package level.
method/resources/ForwardingRequests/ForwardingRequest.pyImplements ForwardingRequests resource and related TypedDicts.
method/resources/ForwardingRequests/init.pyExposes ForwardingRequests resource/types at the package level.
method/resources/Accounts/Types.pyExpands account product/subscription literal values.
method/resources/Accounts/Subscriptions.pyExpands subscription literal values and response TypedDict keys.
method/resources/init.pyRe-exports newly added resources/types from the resources package.
method/resource.pyUpdates the default method-version request header value.
method/method.pyWires new resources onto the Method client (secrets, forwarding_requests, teams, managed_accounts).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtest/resources/TeamMLEPublicKey_test.py
Comment threadtest/resources/Secret_test.py
Comment threadtest/resources/Secret_test.py Outdated
Comment threadtest/resources/Team_test.py
Comment threadtest/resources/ManagedAccount_test.py
Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comments: the five new test modules now carry a
module-level pytestmark skip so they are skipped instead of failing with
auth/network errors when API_KEY is not configured. Also replaces the
loose == None assertion in Secret_test.py with to_dict() is None, which
is lint-clean and equivalent since MethodResponse.__eq__ compares the
wrapped payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 25, 2026 21:26

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Suppressed comments (8)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/Secret_test.py:41

  • These tests depend on state created by test_create_secret via a module-level global. If this test is run in isolation (or if collection/order changes), it will error when secrets_create_response is None. Consider using a fixture that creates the secret and yields the id, or at minimum skip when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 55
  • line 64
def test_retrieve_secret():
global secrets_retrieve_response
secrets_retrieve_response = method.secrets.retrieve(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:56

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.

This issue also appears in the following locations of the same file:

  • line 61
  • line 80
def test_list_mle_public_keys():
global public_keys_list_response
public_keys_list_response = method.teams.mle.public_keys.list()
public_key_ids = [public_key['id'] for public_key in public_keys_list_response]

test/resources/ForwardingRequest_test.py:95

  • This test assumes test_create_forwarding_request has populated forwarding_requests_create_response. If the skips are removed and this test is run alone, it will fail when the create response is None. Consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_forwarding_request(setup):
global forwarding_requests_retrieve_response
forwarding_requests_retrieve_response = method.forwarding_requests.retrieve(forwarding_requests_create_response['id'])

method/resources/Teams/Team.py:62

  • TeamEncryptionKeyRSAKey uses camelCase field names (keyModulus/keyExponent) while the rest of the SDK's request/response shapes use snake_case. If the API actually expects snake_case, users will get incorrect type hints; if the API expects camelCase, this becomes a one-off inconsistency in the Python SDK. Please verify and align the field naming with the API and existing SDK conventions.
class TeamEncryptionKeyRSAKey(TypedDict):
keyModulus: str
keyExponent: str

test/resources/Secret_test.py:59

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_list_secrets():
global secrets_list_response
secrets_list_response = method.secrets.list()
secret_ids = [secret['id'] for secret in secrets_list_response]

test/resources/Secret_test.py:67

  • This test assumes test_create_secret has already populated secrets_create_response. When run alone it will fail; either make secret creation a fixture dependency or skip when the prerequisite state is missing.
def test_delete_secret():
global secrets_delete_response
secrets_delete_response = method.secrets.delete(secrets_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:65

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_retrieve_mle_public_key():
global public_keys_retrieve_response
public_keys_retrieve_response = method.teams.mle.public_keys.retrieve(public_keys_create_response['id'])

test/resources/TeamMLEPublicKey_test.py:83

  • This test assumes test_create_mle_public_key has already populated public_keys_create_response. If the test is run in isolation it will fail; consider using a fixture dependency or skipping when the prerequisite state is missing.
def test_delete_mle_public_key():
global public_keys_delete_response
public_keys_delete_response = method.teams.mle.public_keys.delete(public_keys_create_response['id'])

Comment threadtest/resources/ForwardingRequest_test.py
Addresses Copilot review comment: the module fixture now yields and
deletes its secret on teardown so un-skipped runs do not leave active
secrets in the shared dev environment. The entity created by the same
fixture is left in place because entities cannot be deleted via the
public API, matching every other test module in the suite.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

test/resources/ForwardingRequest_test.py:57

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.

This issue also appears on line 93 of the same file.

@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/Secret_test.py:24

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_secret may not run and the created secret can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the secret, yields its id, and reliably cleans it up in a finally/teardown section.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None
def test_create_secret():
global secrets_create_response
secrets_create_response = method.secrets.create({
'value': 'test_secret_value'
})

test/resources/TeamMLEPublicKey_test.py:36

  • These tests share state via module-level globals and depend on execution order; if an earlier assertion fails, test_delete_mle_public_key may not run and the created public key can be left active in the shared dev environment. Consider using a module-scoped fixture that creates the key, yields its id, and reliably deletes/disables it in teardown.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None
def test_create_mle_public_key():
global public_keys_create_response
public_keys_create_response = method.teams.mle.public_keys.create({
'type': 'direct',
'contact': 'engineering@methodfi.com',
'jwk': test_jwk
})

test/resources/ForwardingRequest_test.py:94

  • These forwarding request tests are currently always skipped, even when FWD_REQUEST_URL / FWD_REQUEST_PMT_INST_ID are provided. Using a conditional skip makes the tests runnable in environments that are configured for them without requiring code edits.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Adds delete() to AccountPaymentInstrumentsResource, matching method-node
and DELETE /accounts/{acc_id}/payment_instruments/{pmt_inst_id} in the
2025-12-01 API. Also adds the inbound_achwire_payment type literal and
payload TypedDict (account_number, routing_number, reversal_account) and
the closed status introduced by the same version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 26, 2026 14:28

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (4) — in code that hasn't changed since the last review.

test/resources/TeamMLEPublicKey_test.py:27

  • These tests share state via module-level globals (e.g., public_keys_create_response) and implicitly rely on test execution order. Pytest does not guarantee ordering across plugins/parallelization, and a failure in test_create_* can leave subsequent tests crashing or leaking dev resources. Prefer a module-scoped fixture that creates the key and yields the created id/response, with teardown deleting the key in a finally/fixture finalizer so cleanup happens even if assertions fail.
public_keys_create_response = None
public_keys_retrieve_response = None
public_keys_list_response = None
public_keys_delete_response = None

test/resources/Secret_test.py:17

  • These tests use module-level globals (secrets_create_response, etc.) to pass state between test functions, which makes them order-dependent and fragile under plugins like xdist or random-order. Prefer a fixture that creates a secret, yields its id/response, and deletes it in teardown so the resource is cleaned up even if a test fails mid-run.
secrets_create_response = None
secrets_retrieve_response = None
secrets_list_response = None
secrets_delete_response = None

method/resources/Teams/Team.py:146

  • TeamResource.list() also hard-codes None params, which blocks pagination/filter support at the client level. Accept optional params and forward them to _list to match the rest of the SDK pattern.
 def list(self) -> MethodResponse[List[Team]]:
return super(TeamResource, self)._list(None)

method/resources/Teams/Team.py:120

  • list() currently hard-codes None params, which prevents callers from passing pagination/date filters even though the base _list supports params. For consistency with other resources, accept an optional params dict and forward it to _list.
 def list(self) -> MethodResponse[List[MLEPublicKey]]:
return super(TeamMLEPublicKeysResource, self)._list(None)

test/resources/ForwardingRequest_test.py:58

  • These tests are unconditionally skipped, but if someone removes the skip marker without setting the required env vars, the request will be sent with None bindings/url and fail in a confusing way. Prefer a conditional skip based on FWD_REQUEST_URL and FWD_REQUEST_PMT_INST_ID so the tests only run when configured.
@pytest.mark.skip(reason=SKIP_REASON)
def test_create_forwarding_request(setup):

test/resources/ForwardingRequest_test.py:94

  • Same as above: make the skip conditional on the required env vars so the test suite is self-configuring and fails less surprisingly when the decorator is adjusted.
@pytest.mark.skip(reason=SKIP_REASON)
def test_retrieve_forwarding_request(setup):

Sign up for freeto 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.

3 participants

@christian-method@srikar-methodfi