Skip to content

MacOS Platform Identifier for rules is incorrect #567

Description

@csanders-git

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
    Before submitting a bug report, we ask that you first search existing issues and pull requests to see if someone else may have experienced the same issue or may have already submitted a fix for it.

Python Version & Okta SDK Version(s)

Python v3.11.15
okta 3.4.4

Affected Class/Method(s)

PolicyPlatformOperatingSystemType

Customer Information

Organization Name:
Paid Customer: <yes/no>

Code Snippet

# Your code here

Debug Output / Traceback

/model/policy_platform_operating_system_type.py

Expected Behavior

Reading in auth policies with MacOS as a platform will work

Actual Behavior

Listing any policy rules that are restricted by OS to MacOS will fail.

okta/models/platform_condition_evaluator_platform_operating_system.py", line 107, in from_dict
    _obj = cls.model_validate(
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/chaimsanders/src/okta_auth_policies_analysis/venv/lib/python3.11/site-packages/pydantic/main.py", line 732, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for PlatformConditionEvaluatorPlatformOperatingSystem
type
  Input should be 'ANDROID', 'ANY', 'IOS', 'OSX', 'OTHER' or 'WINDOWS' [type=enum, input_value='MACOS', input_type=str]

Reading raw rules JSON it appears the following is valid

            "platform": {
                "include": [
                    {
                        "type": "DESKTOP",
                        "os": {
                            "type": "MACOS"
                        }
                    }
                ],
                "exclude": []
            },

Policy docs also reference MACOS as a valid enum -- https://developer.okta.com/docs/api/openapi/okta-management/management/tags/policy/other/createpolicyrule

Therefore it seems that the package has incorrectly selected OSX as the enum type and should be updated.

Steps to reproduce

  1. make a policy with rules that are restricted to macos
  2. try and read rule

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions