src/Util/LTI13.php
public static function jonPostel($body, &$failures) {
        if ( isset($CFG->jon_postel) ) return; // We are on Jon Postel mode

        // Sanity checks
        $version = false;
        if ( isset($body->{self::VERSION_CLAIM}) ) $version = $body->{self::VERSION_CLAIM};
        if ( strpos($version, '1.3') !== 0 ) $failures[] = "Bad LTI version: ".$version;

        $message_type = false;
        if ( isset($body->{self::MESSAGE_TYPE_CLAIM}) ) $message_type = $body->{self::MESSAGE_TYPE_CLAIM};
        if ( ! $message_type ) {
            $failures[] = "Missing message type";
        } else if ( $message_type == self::MESSAGE_TYPE_RESOURCE ) {
            // Required
            if ( ! isset($body->{self::RESOURCE_LINK_CLAIM}) ) $failures[] = "Missing required resource_link claim";
            if ( ! isset($body->{self::RESOURCE_LINK_CLAIM}->id) ) $failures[] = "Missing required resource_link id";
        } else if ( $message_type == self::MESSAGE_TYPE_DEEPLINK ) {
            // OK
        } else {
            $failures[] = "Bad message type: ".$message_type;
        }

        if ( ! isset($body->{self::ROLES_CLAIM}) ) $failures[] = "Missing required role claim";
        if ( ! isset($body->{self::DEPLOYMENT_ID}) ) $failures[] = "Missing required deployment_id claim";
    }
public static function jonPostel($body, &$failures) {
        if ( isset($CFG->jon_postel) ) return; // We are on Jon Postel mode

        // Sanity checks
        $version = false;
        if ( isset($body->{self::VERSION_CLAIM}) ) $version = $body->{self::VERSION_CLAIM};
        if ( strpos($version, '1.3') !== 0 ) $failures[] = "Bad LTI version: ".$version;

        $message_type = false;
        if ( isset($body->{self::MESSAGE_TYPE_CLAIM}) ) $message_type = $body->{self::MESSAGE_TYPE_CLAIM};
        if ( ! $message_type ) {
            $failures[] = "Missing message type";
        } else if ( $message_type == self::MESSAGE_TYPE_RESOURCE ) {
            // Required
            if ( ! isset($body->{self::RESOURCE_LINK_CLAIM}) ) $failures[] = "Missing required resource_link claim";
            if ( ! isset($body->{self::RESOURCE_LINK_CLAIM}->id) ) $failures[] = "Missing required resource_link id";
        } else if ( $message_type == self::MESSAGE_TYPE_DEEPLINK ) {
            // OK
        } else {
            $failures[] = "Bad message type: ".$message_type;
        }

        if ( ! isset($body->{self::ROLES_CLAIM}) ) $failures[] = "Missing required role claim";
        if ( ! isset($body->{self::DEPLOYMENT_ID}) ) $failures[] = "Missing required deployment_id claim";
    }
public static function jonPostel ( $ body , & $ failures ) { if ( isset ( $ CFG -> jon_postel ) ) return ; // We are on Jon Postel mode // Sanity checks $ version = false ; if ( isset ( $ body -> { self :: VERSION_CLAIM } ) ) $ version = $ body -> { self :: VERSION_CLAIM } ; if ( strpos ( $ version , '1.3' ) !== 0 ) $ failures [ ] = "Bad LTI version: " . $ version ; $ message_type = false ; if ( isset ( $ body -> { self :: MESSAGE_TYPE_CLAIM } ) ) $ message_type = $ body -> { self :: MESSAGE_TYPE_CLAIM } ; if ( ! $ message_type ) { $ failures [ ] = "Missing message type" ; } else if ( $ message_type == self :: MESSAGE_TYPE_RESOURCE ) { // Required if ( ! isset ( $ body -> { self :: RESOURCE_LINK_CLAIM } ) ) $ failures [ ] = "Missing required resource_link claim" ; if ( ! isset ( $ body -> { self :: RESOURCE_LINK_CLAIM } -> id ) ) $ failures [ ] = "Missing required resource_link id" ; } else if ( $ message_type == self :: MESSAGE_TYPE_DEEPLINK ) { // OK } else { $ failures [ ] = "Bad message type: " . $ message_type ; } if ( ! isset ( $ body -> { self :: ROLES_CLAIM } ) ) $ failures [ ] = "Missing required role claim" ; if ( ! isset ( $ body -> { self :: DEPLOYMENT_ID } ) ) $ failures [ ] = "Missing required deployment_id claim" ; }
Apply Jon Postel's Law as appropriate

Postel's Law - https://en.wikipedia.org/wiki/Robustness_principle

"TCP implementations should follow a general principle of robustness:
be conservative in what you do, be liberal in what you accept from others."

By default, Jon Postel mode is off and we are stricter than we need to be.
This works well because it reduces the arguments with the certification
folks.   But if you add:

$CFG->jon_postel = true;

Tsugi will follow Jon Postel's law.
Apply Jon Postel s Law as appropriate