File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
src/Api/Billing/Controllers/VNext Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ using Bit . Api . AdminConsole . Authorization ;
2+ using Bit . Api . AdminConsole . Authorization . Requirements ;
3+ using Bit . Api . Billing . Attributes ;
4+ using Bit . Core ;
5+ using Bit . Core . AdminConsole . Entities ;
6+ using Bit . Core . Billing . Organizations . Queries ;
7+ using Bit . Core . Utilities ;
8+ using Microsoft . AspNetCore . Authorization ;
9+ using Microsoft . AspNetCore . Mvc ;
10+ using Microsoft . AspNetCore . Mvc . ModelBinding ;
11+
12+ namespace Bit . Api . Billing . Controllers . VNext ;
13+
14+ [ Authorize ( "Application" ) ]
15+ [ Route ( "organizations/{organizationId:guid}/billing/vnext/self-host" ) ]
16+ [ SelfHosted ( SelfHostedOnly = true ) ]
17+ public class SelfHostedBillingController (
18+ IGetOrganizationMetadataQuery getOrganizationMetadataQuery ) : BaseBillingController
19+ {
20+ [ Authorize < MemberOrProviderRequirement > ]
21+ [ HttpGet ( "metadata" ) ]
22+ [ RequireFeature ( FeatureFlagKeys . PM25379_UseNewOrganizationMetadataStructure ) ]
23+ [ InjectOrganization ]
24+ public async Task < IResult > GetMetadataAsync ( [ BindNever ] Organization organization )
25+ {
26+ var metadata = await getOrganizationMetadataQuery . Run ( organization ) ;
27+
28+ if ( metadata == null )
29+ {
30+ return TypedResults . NotFound ( ) ;
31+ }
32+
33+ return TypedResults . Ok ( metadata ) ;
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments