Merge "More flexible API enforcement policy support." into pi-dev