MCPcopy Create free account
hub / github.com/Noumena-Network/code / buildAccountProperties

Function buildAccountProperties

src/auth/runtime/status.ts:43–92  ·  view source on GitHub ↗
(view: Omit<AuthStatusView, 'accountProperties'>)

Source from the content-addressed store, hash-verified

41}
42
43function buildAccountProperties(view: Omit<AuthStatusView, 'accountProperties'>): AuthStatusProperty[] {
44 const properties: AuthStatusProperty[] = []
45 const expiredSuffix = view.authExpired ? ' (expired)' : ''
46
47 if (view.subscriptionName) {
48 properties.push({
49 label: 'Login method',
50 value: `${view.subscriptionName} Account${expiredSuffix}`,
51 })
52 } else if (
53 view.authMethod === 'managed_oauth' ||
54 view.authMethod === 'managed_oauth_expired' ||
55 view.authMethod === 'console'
56 ) {
57 properties.push({
58 label: 'Login method',
59 value: `Noumena Managed Account${expiredSuffix}`,
60 })
61 }
62
63 if (view.authTokenSource) {
64 properties.push({
65 label: 'Auth token',
66 value: `${view.authTokenSource}${expiredSuffix}`,
67 })
68 }
69
70 if (view.apiKeySource) {
71 properties.push({
72 label: 'API key',
73 value: view.apiKeySource,
74 })
75 }
76
77 if (view.orgName && !process.env.IS_DEMO) {
78 properties.push({
79 label: 'Organization',
80 value: view.orgName,
81 })
82 }
83
84 if (view.email && !process.env.IS_DEMO) {
85 properties.push({
86 label: 'Email',
87 value: view.email,
88 })
89 }
90
91 return properties
92}
93
94export function buildAuthStatusView(
95 session: ResolvedAuthSession,

Callers 1

buildAuthStatusViewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected