Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions interfaces/openapi-to-go-server/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def filter_operations(self, tags: Set[str]):
self.data_types = [dt for dt in self.data_types
if dt.name in required_data_types]

def security_scopes(self) -> Set[Tuple[str, operations.Scope]]:
def security_scopes(self) -> List[Tuple[str, operations.Scope]]:
"""Returns a set of unique security scopes used by this API.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nb: it's still a set of scopes, just represented as a list, so I didn't changed the description, but we may want to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are losing the deduplication in case the scope is defined multiple times, no ?
Wouldn't it be better to sort on the rendering side ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not, the function itself is still using a set to do deduplication.

For the location of the sort, I would think it's better there, as everyone using the function is taking advantage of the sort. (But right now it's only used once)


:return: set of unique tuples containing the authorization scheme and scope
Expand All @@ -70,7 +70,7 @@ def security_scopes(self) -> Set[Tuple[str, operations.Scope]]:
for scheme, scopes in so.option.items():
for scope in scopes:
scopes_set.add((scheme, scope))
return scopes_set
return sorted(scopes_set, key=lambda s: s[1].name)


def make_api(package: str, api_path: str, spec: Dict) -> API:
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/auxv1/interface.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
)

var (
DssReadIdentificationServiceAreasScope = api.RequiredScope("dss.read.identification_service_areas")
DssWriteIdentificationServiceAreasScope = api.RequiredScope("dss.write.identification_service_areas")
InterussPoolStatusHeartbeatWriteScope = api.RequiredScope("interuss.pool_status.heartbeat.write")
InterussPoolStatusReadScope = api.RequiredScope("interuss.pool_status.read")
DssWriteIdentificationServiceAreasScope = api.RequiredScope("dss.write.identification_service_areas")
DssReadIdentificationServiceAreasScope = api.RequiredScope("dss.read.identification_service_areas")
GetVersionSecurity = []api.AuthorizationOption{}
ValidateOauthSecurity = []api.AuthorizationOption{
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/ridv2/interface.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

var (
RidServiceProviderScope = api.RequiredScope("rid.service_provider")
RidDisplayProviderScope = api.RequiredScope("rid.display_provider")
RidServiceProviderScope = api.RequiredScope("rid.service_provider")
SearchIdentificationServiceAreasSecurity = []api.AuthorizationOption{
{
"Authority": {RidDisplayProviderScope},
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/scdv1/interface.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

var (
UtmAvailabilityArbitrationScope = api.RequiredScope("utm.availability_arbitration")
UtmConstraintManagementScope = api.RequiredScope("utm.constraint_management")
UtmConformanceMonitoringSaScope = api.RequiredScope("utm.conformance_monitoring_sa")
UtmStrategicCoordinationScope = api.RequiredScope("utm.strategic_coordination")
UtmConstraintManagementScope = api.RequiredScope("utm.constraint_management")
UtmConstraintProcessingScope = api.RequiredScope("utm.constraint_processing")
UtmStrategicCoordinationScope = api.RequiredScope("utm.strategic_coordination")
QueryOperationalIntentReferencesSecurity = []api.AuthorizationOption{
{
"Authority": {UtmStrategicCoordinationScope},
Expand Down
Loading