Skip to content

Commit b47d12c

Browse files
committed
chore: normalise log and storage key names for hawtio online
1 parent cf39ae1 commit b47d12c

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

packages/kubernetes-api/src/client/globals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Logger } from '@hawtio/react'
22
import { KubeObject } from '../globals'
33
import { WatchActions, WatchTypes } from '../model'
44

5-
export const log = Logger.get('hawtio-k8s-objects')
5+
export const log = Logger.get('hawtio-online-k8s-objects')
66

77
// Allow clients to add other types to force polling under whatever circumstances
88
export const pollingOnly = [WatchTypes.IMAGE_STREAM_TAGS]

packages/kubernetes-api/src/globals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Logger } from '@hawtio/react'
22
import { NamespaceSpec, NamespaceStatus, Pod } from 'kubernetes-types/core/v1'
33
import { ObjectMeta } from 'kubernetes-types/meta/v1'
44

5-
export const pluginName = 'hawtio-k8s-api'
5+
export const pluginName = 'hawtio-online-k8s-api'
66
export const log = Logger.get(pluginName)
77

88
export const K8S_PREFIX = 'api'

packages/management-api/src/globals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Logger } from '@hawtio/react'
22

3-
export const pluginName = 'hawtio-management-api'
3+
export const pluginName = 'hawtio-online-management-api'
44
export const log = Logger.get(pluginName)
55

66
/*

packages/oauth/src/form/globals.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
export const FORM_AUTH_PROTOCOL_MODULE = 'hawtio-form-auth'
22

3-
export const FORM_AUTH_PROTOCOL_MODULE_FORM = `${FORM_AUTH_PROTOCOL_MODULE}-login-form`
4-
5-
export const FORM_TOKEN_STORAGE_KEY = 'formAuthToken'
3+
export const FORM_TOKEN_STORAGE_KEY = 'online.oauth.form.token'
64

75
export interface FormConfig {
86
uri: string

packages/oauth/src/globals.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Logger } from '@hawtio/react'
22

3-
export const log = Logger.get('hawtio-oauth')
3+
export const pluginName = 'hawtio-online-oauth'
4+
export const log = Logger.get(pluginName)
45
export const PATH_OSCONSOLE_CLIENT_CONFIG = 'osconsole/config.json'
56
export const LOGOUT_ENDPOINT = '/auth/logout'
67

packages/oauth/src/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { hawtio, HawtioPlugin } from '@hawtio/react'
2-
import { log } from './globals'
32
import { getActiveProfile } from './api'
4-
import { oAuthService } from './oauth-service'
5-
import { FORM_AUTH_PROTOCOL_MODULE, FORM_AUTH_PROTOCOL_MODULE_FORM } from './form/globals'
63
import { FormAuthLoginForm } from './form'
4+
import { FORM_AUTH_PROTOCOL_MODULE } from './form/globals'
5+
import { log } from './globals'
6+
import { oAuthService } from './oauth-service'
77

88
let initialised = false
99

@@ -26,10 +26,10 @@ export function oAuthInitialised(): boolean {
2626
}
2727

2828
export const oAuthInit: HawtioPlugin = async () => {
29-
if (hawtio.getPlugins().filter(plugin => plugin.id === FORM_AUTH_PROTOCOL_MODULE).length === 0) {
29+
if (hawtio.getPlugins().filter(plugin => plugin.id === 'online-oauth').length === 0) {
3030
hawtio.addPlugin({
31-
id: FORM_AUTH_PROTOCOL_MODULE,
32-
title: FORM_AUTH_PROTOCOL_MODULE_FORM,
31+
id: 'online-oauth',
32+
title: 'Online OAuth',
3333
path: '/login',
3434
isLogin: true,
3535
component: FormAuthLoginForm,
@@ -44,8 +44,8 @@ export const oAuthInit: HawtioPlugin = async () => {
4444
await oAuthRegister()
4545
}
4646

47-
export * from './metadata'
48-
export * from './globals'
4947
export * from './api'
50-
export * from './openshift'
5148
export * from './form'
49+
export * from './globals'
50+
export * from './metadata'
51+
export * from './openshift'

packages/oauth/src/openshift/support.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { log, UserProfile } from '../globals'
22
import { logoutRedirect, redirect, relToAbsUrl, secureDispose, secureRetrieve, secureStore } from '../utils'
33
import { EXPIRES_IN_KEY, OBTAINED_AT_KEY, OpenShiftOAuthConfig, TokenMetadata } from './globals'
44

5-
const OS_TOKEN_STORAGE_KEY = 'osAuthCreds'
5+
const OS_TOKEN_STORAGE_KEY = 'online.oauth.openshift.credentials'
66

77
export function currentTimeSeconds(): number {
88
return Math.floor(new Date().getTime() / 1000)

0 commit comments

Comments
 (0)