Skip to content

Commit

Permalink
Align vocabulary aliases in vocab definition files (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl authored Jan 31, 2024
1 parent ffefd20 commit 8e9f6f6
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 41 deletions.
2 changes: 1 addition & 1 deletion examples/Org.OData.Capabilities.V1.permissions-sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
</Record>
</Annotation>
</Annotations>
<!-- Annotating container with Auth Schemes that contain all the scopes applicable per that security scheme. Graph has 3 security schemes,
<!-- Annotating container with authorization schemes that contain all the scopes applicable per that security scheme. Microsoft Graph has three security schemes,
DelegatedWork, DelegatedPersonal, Application -->
<Annotations Target="microsoft.graph.GraphService">
<Annotation Term="Auth.Authorizations">
Expand Down
12 changes: 4 additions & 8 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@

The example shows several ways to specify insert and update restrictions on various levels.


## [Filter Restrictions](Org.OData.Capabilities.V1.FilterRestrictions-sample.xml)

This example shows a filter restriction to "multiple values", i.e. to `eq` or `in` expressions.

This example shows a filter restriction to "multiple values", i.e. to `eq` or `in` expressions.

## [JSON Schema](Org.OData.JSON.V1.Schema-sample.xml)

This example shows a type definition of a "JSON Stream" property with an attached JSON Schema to describe/restrict the possible JSON values.

## [Permissions](Org.OData.Capabilities.V1.permissions-sample.xml)

## [Permissions](Org.OData.Capabilities.V1.permissions-sample.xml)

Permissions property defined under Read, Insert, Update, Delete in the capabilities vocabulary, gives the ability to list Auth flows and scopes within those flows required to perform operations on an entity set.

Permissions property defined under Read, Insert, Update, Delete in the capabilities vocabulary, gives the ability to list authorization flows and scopes within those flows required to perform operations on an entity set.

## [Sales Model](Org.OData.Aggregation.V1.SalesModel.md)

Example model used in the [OData-Aggr] specification.
Example model used in the [OData Extension for Data Aggregation](https://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/odata-data-aggregation-ext-v4.0.html) specification.
28 changes: 14 additions & 14 deletions vocabularies/Org.OData.Authorization.V1.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"Org.OData.Authorization.V1": {
"$Alias": "Auth",
"$Alias": "Authorization",
"@Core.Description": "The Authorization Vocabulary provides terms for describing authorization requirements of the service",
"@Core.Links": [
{
Expand All @@ -30,7 +30,7 @@
"SecuritySchemes": {
"$Kind": "Term",
"$Collection": true,
"$Type": "Auth.SecurityScheme",
"$Type": "Authorization.SecurityScheme",
"$AppliesTo": [
"EntityContainer"
],
Expand All @@ -39,7 +39,7 @@
"SecurityScheme": {
"$Kind": "ComplexType",
"Authorization": {
"$Type": "Auth.SchemeName",
"$Type": "Authorization.SchemeName",
"@Core.Description": "The name of a required authorization scheme"
},
"RequiredScopes": {
Expand All @@ -50,7 +50,7 @@
"Authorizations": {
"$Kind": "Term",
"$Collection": true,
"$Type": "Auth.Authorization",
"$Type": "Authorization.Authorization",
"$AppliesTo": [
"EntityContainer"
],
Expand All @@ -70,15 +70,15 @@
},
"OpenIDConnect": {
"$Kind": "ComplexType",
"$BaseType": "Auth.Authorization",
"$BaseType": "Authorization.Authorization",
"IssuerUrl": {
"@Core.Description": "Issuer location for the OpenID Provider. Configuration information can be obtained by appending `/.well-known/openid-configuration` to this Url.",
"@Core.IsURL": true
}
},
"Http": {
"$Kind": "ComplexType",
"$BaseType": "Auth.Authorization",
"$BaseType": "Authorization.Authorization",
"Scheme": {
"@Core.Description": "HTTP Authorization scheme to be used in the Authorization header, as per RFC7235"
},
Expand All @@ -90,10 +90,10 @@
"OAuthAuthorization": {
"$Kind": "ComplexType",
"$Abstract": true,
"$BaseType": "Auth.Authorization",
"$BaseType": "Authorization.Authorization",
"Scopes": {
"$Collection": true,
"$Type": "Auth.AuthorizationScope",
"$Type": "Authorization.AuthorizationScope",
"@Core.Description": "Available scopes"
},
"RefreshUrl": {
Expand All @@ -104,31 +104,31 @@
},
"OAuth2ClientCredentials": {
"$Kind": "ComplexType",
"$BaseType": "Auth.OAuthAuthorization",
"$BaseType": "Authorization.OAuthAuthorization",
"TokenUrl": {
"@Core.Description": "Token Url",
"@Core.IsURL": true
}
},
"OAuth2Implicit": {
"$Kind": "ComplexType",
"$BaseType": "Auth.OAuthAuthorization",
"$BaseType": "Authorization.OAuthAuthorization",
"AuthorizationUrl": {
"@Core.Description": "Authorization URL",
"@Core.IsURL": true
}
},
"OAuth2Password": {
"$Kind": "ComplexType",
"$BaseType": "Auth.OAuthAuthorization",
"$BaseType": "Authorization.OAuthAuthorization",
"TokenUrl": {
"@Core.Description": "Token Url",
"@Core.IsURL": true
}
},
"OAuth2AuthCode": {
"$Kind": "ComplexType",
"$BaseType": "Auth.OAuthAuthorization",
"$BaseType": "Authorization.OAuthAuthorization",
"AuthorizationUrl": {
"@Core.Description": "Authorization URL",
"@Core.IsURL": true
Expand All @@ -153,12 +153,12 @@
},
"ApiKey": {
"$Kind": "ComplexType",
"$BaseType": "Auth.Authorization",
"$BaseType": "Authorization.Authorization",
"KeyName": {
"@Core.Description": "The name of the header or query parameter"
},
"Location": {
"$Type": "Auth.KeyLocation",
"$Type": "Authorization.KeyLocation",
"@Core.Description": "Whether the API Key is passed in the header or as a query option"
}
},
Expand Down
28 changes: 14 additions & 14 deletions vocabularies/Org.OData.Authorization.V1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<edmx:Include Namespace="Org.OData.Core.V1" Alias="Core" />
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Org.OData.Authorization.V1" Alias="Auth">
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Org.OData.Authorization.V1" Alias="Authorization">
<Annotation Term="Core.Description" String="The Authorization Vocabulary provides terms for describing authorization requirements of the service" />
<Annotation Term="Core.Links">
<Collection>
Expand All @@ -62,20 +62,20 @@
</Collection>
</Annotation>

<Term Name="SecuritySchemes" Type="Collection(Auth.SecurityScheme)" Nullable="false" AppliesTo="EntityContainer">
<Term Name="SecuritySchemes" Type="Collection(Authorization.SecurityScheme)" Nullable="false" AppliesTo="EntityContainer">
<Annotation Term="Core.Description" String="At least one of the specified security schemes are required to make a request against the service" />
</Term>

<ComplexType Name="SecurityScheme">
<Property Name="Authorization" Type="Auth.SchemeName" Nullable="false">
<Property Name="Authorization" Type="Authorization.SchemeName" Nullable="false">
<Annotation Term="Core.Description" String="The name of a required authorization scheme" />
</Property>
<Property Name="RequiredScopes" Type="Collection(Edm.String)" Nullable="false">
<Annotation Term="Core.Description" String="The names of scopes required from this authorization scheme" />
</Property>
</ComplexType>

<Term Name="Authorizations" Type="Collection(Auth.Authorization)" Nullable="false" AppliesTo="EntityContainer">
<Term Name="Authorizations" Type="Collection(Authorization.Authorization)" Nullable="false" AppliesTo="EntityContainer">
<Annotation Term="Core.Description" String="Lists the methods supported by the service to authorize access" />
</Term>

Expand All @@ -89,14 +89,14 @@
</Property>
</ComplexType>

<ComplexType Name="OpenIDConnect" BaseType="Auth.Authorization">
<ComplexType Name="OpenIDConnect" BaseType="Authorization.Authorization">
<Property Name="IssuerUrl" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="Issuer location for the OpenID Provider. Configuration information can be obtained by appending `/.well-known/openid-configuration` to this Url." />
<Annotation Term="Core.IsURL" />
</Property>
</ComplexType>

<ComplexType Name="Http" BaseType="Auth.Authorization">
<ComplexType Name="Http" BaseType="Authorization.Authorization">
<Property Name="Scheme" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="HTTP Authorization scheme to be used in the Authorization header, as per RFC7235" />
</Property>
Expand All @@ -105,8 +105,8 @@
</Property>
</ComplexType>

<ComplexType Name="OAuthAuthorization" BaseType="Auth.Authorization" Abstract="true">
<Property Name="Scopes" Type="Collection(Auth.AuthorizationScope)" Nullable="false">
<ComplexType Name="OAuthAuthorization" BaseType="Authorization.Authorization" Abstract="true">
<Property Name="Scopes" Type="Collection(Authorization.AuthorizationScope)" Nullable="false">
<Annotation Term="Core.Description" String="Available scopes" />
</Property>
<Property Name="RefreshUrl" Type="Edm.String" Nullable="true">
Expand All @@ -115,28 +115,28 @@
</Property>
</ComplexType>

<ComplexType Name="OAuth2ClientCredentials" BaseType="Auth.OAuthAuthorization">
<ComplexType Name="OAuth2ClientCredentials" BaseType="Authorization.OAuthAuthorization">
<Property Name="TokenUrl" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="Token Url" />
<Annotation Term="Core.IsURL" />
</Property>
</ComplexType>

<ComplexType Name="OAuth2Implicit" BaseType="Auth.OAuthAuthorization">
<ComplexType Name="OAuth2Implicit" BaseType="Authorization.OAuthAuthorization">
<Property Name="AuthorizationUrl" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="Authorization URL" />
<Annotation Term="Core.IsURL" />
</Property>
</ComplexType>

<ComplexType Name="OAuth2Password" BaseType="Auth.OAuthAuthorization">
<ComplexType Name="OAuth2Password" BaseType="Authorization.OAuthAuthorization">
<Property Name="TokenUrl" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="Token Url" />
<Annotation Term="Core.IsURL" />
</Property>
</ComplexType>

<ComplexType Name="OAuth2AuthCode" BaseType="Auth.OAuthAuthorization">
<ComplexType Name="OAuth2AuthCode" BaseType="Authorization.OAuthAuthorization">
<Property Name="AuthorizationUrl" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="Authorization URL" />
<Annotation Term="Core.IsURL" />
Expand All @@ -160,11 +160,11 @@
</Property>
</ComplexType>

<ComplexType Name="ApiKey" BaseType="Auth.Authorization">
<ComplexType Name="ApiKey" BaseType="Authorization.Authorization">
<Property Name="KeyName" Type="Edm.String" Nullable="false">
<Annotation Term="Core.Description" String="The name of the header or query parameter" />
</Property>
<Property Name="Location" Type="Auth.KeyLocation" Nullable="false">
<Property Name="Location" Type="Authorization.KeyLocation" Nullable="false">
<Annotation Term="Core.Description" String="Whether the API Key is passed in the header or as a query option" />
</Property>
</ComplexType>
Expand Down
4 changes: 2 additions & 2 deletions vocabularies/Org.OData.Capabilities.V1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"$Include": [
{
"$Namespace": "Org.OData.Authorization.V1",
"$Alias": "Auth"
"$Alias": "Authorization"
}
]
},
Expand Down Expand Up @@ -848,7 +848,7 @@
"PermissionType": {
"$Kind": "ComplexType",
"SchemeName": {
"$Type": "Auth.SchemeName",
"$Type": "Authorization.SchemeName",
"@Core.Description": "Authorization flow scheme name"
},
"Scopes": {
Expand Down
4 changes: 2 additions & 2 deletions vocabularies/Org.OData.Capabilities.V1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
-->
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Authorization.V1.xml">
<edmx:Include Alias="Auth" Namespace="Org.OData.Authorization.V1" />
<edmx:Include Alias="Authorization" Namespace="Org.OData.Authorization.V1" />
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1" />
Expand Down Expand Up @@ -646,7 +646,7 @@ supported:
</ComplexType>

<ComplexType Name="PermissionType">
<Property Name="SchemeName" Type="Auth.SchemeName" Nullable="false">
<Property Name="SchemeName" Type="Authorization.SchemeName" Nullable="false">
<Annotation Term="Core.Description" String="Authorization flow scheme name" />
</Property>
<Property Name="Scopes" Type="Collection(Capabilities.ScopeType)" Nullable="false">
Expand Down

0 comments on commit 8e9f6f6

Please sign in to comment.