mattermost/python-sdk/build/lib/mattermost_plugin/grpc/hooks_common_pb2.pyi
Nick Misasi 01643af641 debug: add extensive logging to trace hook registration flow
Go side:
- Log hooks returned by Implemented()
- Log each hook name -> ID mapping
- Log OnActivate implementation status
- Log OnActivate call flow

Python side:
- Log Implemented() return value
- Log OnActivate gRPC receipt and handler invocation

This is temporary debug logging to diagnose why OnActivate
isn't being called for Python plugins.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:12:22 -05:00

82 lines
3.1 KiB
Python

"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
See LICENSE.txt for license information.
"""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
import builtins as _builtins
import sys
import typing as _typing
if sys.version_info >= (3, 10):
from typing import TypeAlias as _TypeAlias
else:
from typing_extensions import TypeAlias as _TypeAlias
DESCRIPTOR: _descriptor.FileDescriptor
@_typing.final
class PluginContext(_message.Message):
"""==============================================================================
HOOK COMMON TYPES
==============================================================================
This file defines shared types used across all plugin hook RPCs.
These types are used to pass context and metadata from the server to
plugins when invoking hooks.
==============================================================================
PluginContext passes through metadata about the request or hook event.
Maps to plugin.Context in Go (server/public/plugin/context.go).
This context is passed to hooks that require request-level information,
such as session details, request tracing, and client metadata.
Note: This is distinct from RequestContext (used in API calls) because
hooks receive server-initiated context rather than plugin-initiated context.
"""
DESCRIPTOR: _descriptor.Descriptor
SESSION_ID_FIELD_NUMBER: _builtins.int
REQUEST_ID_FIELD_NUMBER: _builtins.int
IP_ADDRESS_FIELD_NUMBER: _builtins.int
ACCEPT_LANGUAGE_FIELD_NUMBER: _builtins.int
USER_AGENT_FIELD_NUMBER: _builtins.int
session_id: _builtins.str
"""The session ID of the user making the request, if applicable.
Empty for system-initiated hooks not tied to a user session.
"""
request_id: _builtins.str
"""A unique identifier for this request, used for tracing and logging.
Correlates log entries across the server and plugin boundary.
"""
ip_address: _builtins.str
"""The IP address of the client making the request.
May be empty for server-initiated hooks.
"""
accept_language: _builtins.str
"""The Accept-Language header from the client request.
Used for localization. May be empty.
"""
user_agent: _builtins.str
"""The User-Agent header from the client request.
Identifies the client software. May be empty.
"""
def __init__(
self,
*,
session_id: _builtins.str = ...,
request_id: _builtins.str = ...,
ip_address: _builtins.str = ...,
accept_language: _builtins.str = ...,
user_agent: _builtins.str = ...,
) -> None: ...
_ClearFieldArgType: _TypeAlias = _typing.Literal["accept_language", b"accept_language", "ip_address", b"ip_address", "request_id", b"request_id", "session_id", b"session_id", "user_agent", b"user_agent"] # noqa: Y015
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
Global___PluginContext: _TypeAlias = PluginContext # noqa: Y015