Skip to content

Commit afb66f7

Browse files
authored
fix: disable google sheets in prod based on oauth review (#9906)
<!-- Clearly explain the need for these changes: --> Our oauth review wants us to drop this in favor of a diff scope that will require additional work ### Changes 🏗️ Disables the oauth sheets scopes in prod <!-- Concisely describe all of the changes made in this pull request: --> ### Checklist 📋 #### For code changes: - [ ] I have clearly listed my changes in the PR description - [ ] I have made a test plan - [ ] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [ ] set env locally
1 parent 59ec61e commit afb66f7

File tree

1 file changed

+4
-2
lines changed
  • autogpt_platform/backend/backend/blocks/google

1 file changed

+4
-2
lines changed

autogpt_platform/backend/backend/blocks/google/sheets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema
55
from backend.data.model import SchemaField
6-
from backend.util.settings import Settings
6+
from backend.util.settings import AppEnvironment, Settings
77

88
from ._auth import (
99
GOOGLE_OAUTH_IS_CONFIGURED,
@@ -36,13 +36,15 @@ class Output(BlockSchema):
3636
)
3737

3838
def __init__(self):
39+
settings = Settings()
3940
super().__init__(
4041
id="5724e902-3635-47e9-a108-aaa0263a4988",
4142
description="This block reads data from a Google Sheets spreadsheet.",
4243
categories={BlockCategory.DATA},
4344
input_schema=GoogleSheetsReadBlock.Input,
4445
output_schema=GoogleSheetsReadBlock.Output,
45-
disabled=not GOOGLE_OAUTH_IS_CONFIGURED,
46+
disabled=not GOOGLE_OAUTH_IS_CONFIGURED
47+
or settings.config.app_env == AppEnvironment.PRODUCTION,
4648
test_input={
4749
"spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
4850
"range": "Sheet1!A1:B2",

0 commit comments

Comments
 (0)